in reply to Perl Regex

What have you tried and found not to work?

/J\

Replies are listed 'Best First'.
Re^2: Perl Regex
by Anonymous Monk on Jul 08, 2004 at 12:03 UTC
    Excel.

      Heh!

      The first problem I have in dealing with your question is to know what you want to do with. You want to isolate the first number in the line, that's easy enough with

      /^(\d+)/

      But then for the rest, who knows? Do you want the pairs stored in an array of arrays, do you just want to know how many there are (e.g. up to 45). Are there additional constraints on valid tokens?

      e.g. is it always asn followed by a digit in which case /asn\d+/ will match that. If you see asn1 once, will you see it for the rest of the line and nothing else? Is the second part always letter letter letter digit digit digit letter? (update: oops, I missed your explanation of what they contain at a first glance, but the specification is still a little on the vague side).

      At a guess I would say these are postcodes. What are you trying to do, maybe someone has already solved the problem and a module has been written that will do what you want.

      - another intruder with the mooring of the heat of the Perl