My current regex is:
([\d]*)([^\d]*[\d][az]*-[\d]*)([\d][az?])(.?)
So, I'm trying to get the regular expression to match a line based on: a count, which can be any number of numbers from 0 to 1 million, and then a number and then a letter, then any number for numbers followed by the same number, and sometimes a letter, and sometimes a letter. example of strings that must match:
1921-1220104081741b 192123212a-1220234104081742ab
an example of what it should return based on above (these are 2 examples, it should not read both lines.)
(192) (1-122010408174) (1) (b) (19212321) (2a-122023410408174) (2a) (b)
The current current regular expression works with the second, but it returns (1b) in the first when I would like it to return (1) (b), but also return (2a) in case of the second or case:
1926h-1220104081746h Should Return: (192) (6h-122010408174) (6h)
Not sure if 100%, if possible, meaning I'm pretty new to regex. For reference, I am doing this in excel-vba if there is another way to make it easier.
vba excel-vba regex excel
Persiden
source share