Beefy Boxes and Bandwidth Generously Provided by pair Networks kudra
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: CRSC

by xaco (Initiate)
on Feb 08, 2001 at 17:24 UTC ( [id://57225]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to CRSC

It would be nice to have a -n or -p version of this that
could be piped into similar to the Bork program that
sometimes comes with various unices. Then you could
cat files into it and have them translated rather than
having to type them in one line at a time.

Also, there's a bug for the word pub, which is translated to
nuclear sub. The sub is then translated to rubber dub
below, so pub becomes nuclear rubber dub.

-xaco

Replies are listed 'Best First'.
Re: Re: CRSC
by pne (Novice) on Sep 05, 2001 at 07:20 UTC

    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'" :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://57225]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.