Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Regex matching on anywhere but the beginning or end of a line

by OM_Zen (Scribe)
on Feb 23, 2003 at 01:53 UTC ( [id://237834]=note: print w/replies, xml ) Need Help??


in reply to Regex matching on anywhere but the beginning or end of a line

Hi ,

my $var = q("string (12" or 1 foot or 1') into 6" MySQL varchar") +; $var =~ s/(?<!^)"(?!$)/""/g; print "[$var]\n"; __END__ ["string (12"" or 1 foot or 1') into 6"" MySQL varchar"]


The look_ahead and look_behind negative assertion on ^ and $ shall do the match only in the other places of the string

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 12:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found