Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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


Replies are listed 'Best First'.
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.

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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2016-10-23 04:17 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (300 votes). Check out past polls.