Home All Groups Group Topic Archive Search About
Author
31 Dec 2006 7:19 AM
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!

Author
31 Dec 2006 8:32 AM
Spam Catcher
"Paulers" <SuperG***@gmail.com> wrote in news:1167549590.725794.57370
@a3g2000cwd.googlegroups.com:

> 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.
Author
31 Dec 2006 8:36 AM
Just Me
Like to have a go at my question spamcatcher, its a two down from this one

Thanks - JustMe

Show quoteHide quote
"Spam Catcher" <spamhoneypot@rogers.com> wrote in message
news:Xns98AA23EDF6731usenethoneypotrogers@127.0.0.1...
> "Paulers" <SuperG***@gmail.com> wrote in news:1167549590.725794.57370
> @a3g2000cwd.googlegroups.com:
>
>> 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.
>
Author
31 Dec 2006 9:15 AM
Spam Catcher
"Just Me" <news.microsoft.com> wrote in
news:#A8nNbLLHHA.3872@TK2MSFTNGP06.phx.gbl:

> 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 ;-)
Author
31 Dec 2006 7:49 PM
Paulers
so this expression would match multiple instances of 15 digits in a
string? Ill give it a try. thanks!
Spam Catcher wrote:
Show quoteHide quote
> "Paulers" <SuperG***@gmail.com> wrote in news:1167549590.725794.57370
> @a3g2000cwd.googlegroups.com:
>
> > 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.