Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Match whitespace or start-of-string with lookbehind

by etcshadow (Priest)
on Aug 24, 2004 at 03:50 UTC ( #385308=note: print w/replies, xml ) Need Help??


in reply to Match whitespace or start-of-string with lookbehind

It's not precisely the same thing as you're asking for... but would word-boundary (\b) be sufficient?

If not, you can just re-nest the look-behind and the alternation into:

$text =~ s/(^|(?<=\s))"(?=\w)//gs;
That works. They key is that the ^ doesn't have to be look-behind, since it's zero-width, anyway.
------------ :Wq Not an editor command: Wq

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2019-09-15 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (180 votes). Check out past polls.

    Notices?