in reply to Re: Re: More Variable length regex issues
in thread More Variable length regex issues

Thanks for that. So the answer is, don't use square brackets as delimiters if the regex contains (unbalanced) square brackets.

It's a shame that there aren't a couple more sets of balanced brackets in the arsenal:) Preferably a pair that could be used soley for quote-like delimiting. Maybe now we have unicode, we could find a pairing that wouldn't get overloaded for 7 other things too? Some chance I think:)


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller


  • Comment on Re: Re: Re: More Variable length regex issues

Replies are listed 'Best First'.
Re: Re: Re: Re: More Variable length regex issues
by japhy (Canon) on Jun 10, 2003 at 20:41 UTC
    Well, there are the French/German style quotes that look like << and >>... but Perl 6 uses them (believe it or not!).

    You can't use anything other than paren, bracket, brace, or angle-bracket in Perl right now to balance, since they're hardcoded into the parser/tokenizer. But you could certainly choose some obscure unicode character that doesn't need balancing. Actually, if you could tell the parser to include a pair of your own, like ` and ', that'd be cool.

    _____________________________________________________
    Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;