Regex question

  • Thread starter Thread starter Paulers
  • Start date Start date
P

Paulers

I have been googling for about an hour now looking for an example of
how to locate multiple occurrences of a regular expression and
iterate through the matches to extract each one. I need to extract all
occurrences of \d{15} out of a string that will also include carrige
returns, white spaces and other possible characters in random orders.
All help is greatly appreciated
Thanks!
 
I have been googling for about an hour now looking for an example of
how to locate multiple occurrences of a regular expression and
iterate through the matches to extract each one. I need to extract all
occurrences of \d{15} out of a string that will also include carrige
returns, white spaces and other possible characters in random orders.
All help is greatly appreciated


try this pattern: \\d\{15\} (turn on the ignore whitespace option)

The regex class has a "Matches" collection which allows you to iterate
through it.
 
Like to have a go at my question spamcatcher, its a two down from this one

Thanks - JustMe
 
Like to have a go at my question spamcatcher, its a two down from this
one

Sure, just took a look at it... I'm hardly a pro at Regular Expressions,
but I prefer using regex rather than manually parsing with if loops ;-)
 
so this expression would match multiple instances of 15 digits in a
string? Ill give it a try. thanks!
 
Back
Top