Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: String replace

by benizi (Hermit)
on Nov 29, 2005 at 23:10 UTC ( [id://512795]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    For p in products-to-replace:
        c = int rand(@total - @chosen)
        For i in the sorted set of already-chosen items:
    ...
            c++
        Insert c into sorted set
        new{p} = total[c]
    
  2. or download this
    my @random = map $_ x (3 + int rand 5), 'A'..'Z';
    my $product_re = qr/\b[A-Z]+(?:\s[A-Z]+)*\b/;
    
    ...
    The respondent uses the following products XXX, YYYYY, and ZZZZZZ arou
    +nd the house and they are considering using QQQQQQ, too. They are par
    +ticularly impressed with ZZZZZZ.
    Joe Smith used EGGO WAFFLES, FROSTED FLAKES, and RICE KRISPIES around 
    +the house and he is considering using POST SHREDDED WHEAT too. He is 
    +particularly impressed with RICE KRISPIES.
    Bob likes CATS, DOGS, and ZEBRAS, but particularly CATS.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-26 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found