Sue Tippett
asked on
What would be the RegEx pattern in an Access query to return the numeric values until the first alpha?
MS ACCESS 2010
I have a table with a field called CodeLineTxt. That needs to be pasred into fields LineNbr and LineTxt.
Using a query and RegEX how can I Do this?
I need to get the numeric values for data that looks like this:
10090 If something > 10 then
10091 SET something = 40
10092 End if
If want just
10090
10091
10092
The numeric does not always have a length of five. Any numeric value in the remainder of the string is to be ignored.
I have a table with a field called CodeLineTxt. That needs to be pasred into fields LineNbr and LineTxt.
Using a query and RegEX how can I Do this?
I need to get the numeric values for data that looks like this:
10090 If something > 10 then
10091 SET something = 40
10092 End if
If want just
10090
10091
10092
The numeric does not always have a length of five. Any numeric value in the remainder of the string is to be ignored.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you, great solution! Sometimes you forget the easier way.
https://regex101.com/r/tHk
^ asserts position at start of the string
\d matches a digit (equal to [0-9])
* Quantifier — Matches between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Global pattern flags
g modifier: global. All matches (don't return after first match)
m modifier: multi line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)