Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://237834]
help
Chatterbox?
beech oh my *me my*
beech cannot replicate
beech stupid 3d printer
[rajesh_perl]: hi
[Discipulus]: good morning monks! or whatever timezone you are experiencing

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-03-28 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (327 votes). Check out past polls.