Problems? Is your data what you think it is? | |
PerlMonks |
Match whitespace or start-of-string with lookbehindby BigLug (Chaplain) |
on Aug 24, 2004 at 02:39 UTC ( [id://385297]=perlquestion: print w/replies, xml ) | Need Help?? |
BigLug has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to curl my quotes. To do that I need to match a quote after whitespace followed by a character. However what if the quote is the first thing in the string? In that case I need to match start-of-string or whitespace. Here's code that works in my head:
However because ^ is zero-width and \s isn't, I get an error about variable width lookbehind not being supported. How do I do this? Or will I need to use two regexes for this? Cheers! Rick If this is a root node: Before responding, please ensure your clue bit is set. If this is a reply: This is a discussion group, not a helpdesk ... If the discussion happens to answer a question you've asked, that's incidental.
Back to
Seekers of Perl Wisdom
|
|