Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Re: Is there a way I can substitute for ":" except when it is preceded by a letter C

by MrNobo1024 (Hermit)
on Aug 17, 2002 at 02:35 UTC ( #190813=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Is there a way I can substitute for ":" except when it is preceded by a letter C
in thread Is there a way I can substitute for ":" except when it is preceded by a letter C

That's not quite right, the * makes it match even if there's 0 C's, turning all colons into apostrophes, not just the intended ones

s/(^|[^C]):/$1'/g
fixes that, but won't work if there is multiple colons in a row. A negative lookbehind is probably the only way to do this properly.

--MrNobo1024
s]]HrLfbfe|EbBibmv]e|s}w}ciZx^RYhL}e^print


Comment on Re: Re: Re: Is there a way I can substitute for ":" except when it is preceded by a letter C
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2015-07-06 05:34 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 (70 votes), past polls