Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Regex Question in Perl

by AR (Friar)
on Dec 22, 2010 at 18:33 UTC ( [id://878628]=note: print w/replies, xml ) Need Help??


in reply to Regex Question in Perl

Hi mmittiga,

You're using the lazy modifier to your .*. When the regex engine gets to this point, it doesn't attempt to match anything. If you know account numbers are all digits, try changing the line to:

if ( $page2 =~ m/Account number ([\d]+)/g ) {

Replies are listed 'Best First'.
Re^2: Regex Question in Perl
by ikegami (Patriarch) on Dec 22, 2010 at 18:37 UTC
    By the way, /[\d]+/ can be written /\d+/.
Re^2: Regex Question in Perl
by AnomalousMonk (Archbishop) on Dec 22, 2010 at 18:49 UTC

    ... and  /g still makes no sense.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://878628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-26 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found