Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: problems with regular expressions

by kelan (Deacon)
on Oct 05, 2002 at 04:36 UTC ( [id://202994]=note: print w/replies, xml ) Need Help??


in reply to problems with regular expressions

Well, without more specifics as to when the zero will appear, try this:
print if (/(^\s*|\s+)0/); # A zero either: starting a line with possi +ble whitespace in front, or anywhere in a line with ne +cessary whitespace in front.

Update: suaveant's suggestion, above, is simpler and works just as well:   print if (/\b0/);

kelan


Yak it up with Fullscreen ChatterBox

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-16 17:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found