Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 browsing the Monastery: (5)
As of 2015-07-03 18:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (55 votes), past polls