I need to extract numbers followed by an A, until pattern " X " appears:
"50A ABC DE 51A FG X 52A HI 53A"
The regex \d+A(?=.* X ) correctly matches 50A and 51A, because they appear before X
, as shown here.
However, if a string does not have the X pattern, the regex won´t match any of the desired pattens (50A, 51A, 52A and 53A)
"50A ABC DE 51A FG 52A HI 53A" # no X here
How do I fix that?