Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Strange regex behavior

by insaniac (Friar)
on Aug 14, 2005 at 21:16 UTC ( [id://483725]=note: print w/replies, xml ) Need Help??


in reply to Strange regex behavior - beware chunk boundaries!

update: my sleepy eyes didn't look very well at your code :-/
forget my post ;-)

is it just a typo, or did you forget a tilde?

if (/ID=([0-9]+)/) {
? shouldn't this be:
if (/ID=~([0-9]+)/) {

to ask a question is a moment of shame
to remain ignorant is a lifelong shame

Replies are listed 'Best First'.
Re^2: Strange regex behavior
by tame1 (Pilgrim) on Aug 14, 2005 at 21:58 UTC
    Remember, ID= is part of the actual text I am searching for. Perhaps you were thinking along the lines of $var =~ /some-text/, right?

    Anyhow, without specifying what var to work on, that "if" works on $_.
    So it's really if $_ =~ /ID=([0-9]+)/

    --Jon


    What does this little button do . .<Click>; "USER HAS SIGNED OFF FOR THE DAY"
Re^2: Strange regex behavior
by tame1 (Pilgrim) on Aug 14, 2005 at 21:22 UTC
    Nope. That one is as it should be, I think. --Jon


    What does this little button do . .<Click>; "USER HAS SIGNED OFF FOR THE DAY"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-19 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found