Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: CRSC

by pne (Novice)
on Sep 05, 2001 at 11:20 UTC ( #110231=note: print w/ replies, xml ) Need Help??


in reply to Re: CRSC
in thread CRSC

I don't think the "fix" used will work. The line is now:

$eng =~ s/\b(?!p)sub/rubber dub/ig;  # thanks to xaco for spotting this

This looks to me like "replace word/non-word boundary followed by something which is 's' and not 'p' followed by 'u' followed by 'b' by 'rubber dub'". This will still replace 'nuclear sub' with 'nuclear rubber dub'. The (?!p) is superfluous because the next character can never be a 'p' anyway, since you say it must match /s/i.

Easiest is probably just to switch the order of the rules, since you can't say "replace the word 'sub' except it if used to be the word 'pub'" :)


Comment on Re: Re: CRSC
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-07-12 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls