I have lines similar to the following:
4123499-TESCO45-123
every99999994_54
And I want to extract the largest numerical sequence on each line, respectively:
4123499
99999994
I have already tried regex (I am using VB6)
Set rx = New RegExp
rx.Pattern = "[^\d]"
rx.Global = True
StringText = rx.Replace(StringText, "")
Which gets me partially there, but it only removes non-numeric values, and I get the first line that looks like this:
412349945123
Can I find a regex that will give me what I need, or will I have to try another method? Essentially, my pattern should be what is not the longest numerical sequence. But I'm not sure if this is even a reasonable model. Can someone with a better regex handle tell me if I'm going down a rabbit hole? I appreciate any help!