Help building expression
-
Hi, I'm trying to get some expression using regexp that extracts highlighted numbers:
Traveller-CxFlight-895-20240819-1903
Traveller-ETDChange-45-20240819-1903
M-TX6102-20240819-FOC
M-TX7156/20240819Any help would be appreciated.
Based on what you have here you're looking for the first string of digits in a string. Something like
^[^0-9]+([0-9]+).*
should extract the digits. Vary for your flavour of regex Explanation:^ anchors to left
[^0-9]+ matches all non-digits (at least one. Maybe use *
if you may have digits at start of text
([0-9]+) extract a string of digits, at least one
.* matches rest of string"A little song, a little dance, a little seltzer down your pants" Chuckles the clown
-
Based on what you have here you're looking for the first string of digits in a string. Something like
^[^0-9]+([0-9]+).*
should extract the digits. Vary for your flavour of regex Explanation:^ anchors to left
[^0-9]+ matches all non-digits (at least one. Maybe use *
if you may have digits at start of text
([0-9]+) extract a string of digits, at least one
.* matches rest of string"A little song, a little dance, a little seltzer down your pants" Chuckles the clown