Assume the following strings:
A01B100
A01.B100
A01
A01............................B100
( whatever between A and B )
The thing is, the numbers should be \d+
, and in all of the strings A will always be present, while B may not. A will always be followed by one or more digits, and so will B, if present. What regex could I use to capture A and B's digit?
I have the following regex:
(A(\d+)).*?(B?(\d+)?)
but this only works for the first and the third case.