Regex question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paulers

    #1

    Regex question

    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!

  • Spam Catcher

    #2
    Re: Regex question

    "Paulers" <SuperGh0d@gmai l.comwrote in news:1167549590 .725794.57370
    @a3g2000cwd.goo glegroups.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.

    Comment

    • Just Me

      #3
      Re: Regex question

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

      Thanks - JustMe

      "Spam Catcher" <spamhoneypot@r ogers.comwrote in message
      news:Xns98AA23E DF6731usenethon eypotrogers@127 .0.0.1...
      "Paulers" <SuperGh0d@gmai l.comwrote in news:1167549590 .725794.57370
      @a3g2000cwd.goo glegroups.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.
      >

      Comment

      • Spam Catcher

        #4
        Re: Regex question

        "Just Me" <news.microsoft .comwrote in
        news:#A8nNbLLHH A.3872@TK2MSFTN GP06.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 ;-)

        Comment

        • Paulers

          #5
          Re: Regex question

          so this expression would match multiple instances of 15 digits in a
          string? Ill give it a try. thanks!
          Spam Catcher wrote:
          "Paulers" <SuperGh0d@gmai l.comwrote in news:1167549590 .725794.57370
          @a3g2000cwd.goo glegroups.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.

          Comment

          Working...