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

Re: Yet another regex bug.

by particle (Vicar)
on Nov 11, 2002 at 22:36 UTC ( #212127=note: print w/replies, xml ) Need Help??

in reply to Yet another regex bug.

i agree, the current behaviour is a bug.

how would you think it should parse?

i say the '+' should modify the comment, however pointless that may be. modifying the 'c' doesn't seem clear; the modifier should be adjacent to the token on which it acts. dangling modifiers should not be introduced to the already complex pattern matching syntax.

Update: i've changed my tune. as i thought about it more yesterday, i realized my first impression was incorrect. the '(?#)' construct should act the same as a '#' comment in a pattern match with the 'x' modifier. tye is right on, in his response below ((tye)Re: Yet another regex bug..)

~Particle *accelerates*

Replies are listed 'Best First'.
Re: Re: Yet another regex bug.
by theorbtwo (Prior) on Nov 12, 2002 at 05:59 UTC

    I'd say that it should be an warning, or a do-nothing. The + modifies the previous assertation. In this case, the previous assertation is (?#...), which asserts nothing about the stream. Asserting nothing a bunch of times should have the same effect as not asserting nothing at all, or asserting nothing once -- no effect. Of course, asserting nothing more then once probably isn't what you meant, but there's no way of telling what you did mean, so we should warn.

    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://212127]
and the monks are mute...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2017-06-24 10:04 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (557 votes). Check out past polls.