in reply to How to cater a self defined escape char in regex ?

Hi there,

Have a feeling there is more to the story that what you've revealed in your question. You didn't give us any working code, or even an idea about what "$obj" may be. But the obvious question is, why not just remove the '(' and ')' from $who before proceeding?

  • Comment on Re: How to cater a self defined escape char in regex ?

Replies are listed 'Best First'.
Re^2: How to cater a self defined escape char in regex ?
by exilepanda (Friar) on Apr 08, 2013 at 17:08 UTC
    Thanks Loops, this is really a rephrased snip story, which I think to post the whole story only even making what I want to ask become more ambiguous. However, this is a good lesson learned for how to ask more properly.

    If there's a second go, I'd ask my question in this way.

    $str = '#{XX(' . $unknownString . ')}#';

    Then how do I write an regex to get $1 eq $unknownString from $str? Provided the $str was actually reading from a random text file, so I cannot pre-modify it before I run the regex.