Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 ( #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


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2014-08-22 18:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (163 votes), past polls