Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

RE: codem/(?:-x pattern) #comment /x bug?/code

by Shendal (Hermit)
on Sep 08, 2000 at 00:08 UTC ( #31468=note: print w/ replies, xml ) Need Help??


in reply to codem/(?:-x pattern) #comment /x bug?/code

Tried your code with perl 5.6 (activestate build), and it works like a champ.

Output: PATTERN=m/(?-x:(abcdef))/x ANSWER = abcdef PATTERN=m/(?-x:(abcdef)) # comment here/x ANSWER = abcdef

Cheers,
Shendal


Comment on RE: codem/(?:-x pattern) #comment /x bug?/code
Download Code
RE: RE: codem/(?:-x pattern) #comment /x bug?/code
by dcorbin (Sexton) on Sep 08, 2000 at 00:13 UTC
    Sounds like a bug that's been fixed then.
RE: RE: codem/(?:-x pattern) #comment /x bug?/code
by Fastolfe (Vicar) on Sep 08, 2000 at 00:15 UTC
    I tried this with 5.00551 on Solaris 2.6 (egcs 2.91.57) and it failed on the 2nd pattern like the original poster. At first it seemed like the (?-x:...) bit was negating the x flag for the entire regexp, but I tried adding the comment to the pattern and it still failed to match, so I'm not sure. Very odd.

    Like another poster, I was thinking that the end of the regexp being on the same line as the comment was causing the /x to be ignored (interpreted as part of the comment), but adding whitespace in there caused the pattern to fail in both cases (odd). Something isn't right.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (16)
As of 2014-09-22 20:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (200 votes), past polls