RegEx to randomly set case of characters in a string -


I am looking at the case of the character of the string given for the use of a testing function for RAGX.

Example input:

  Quick brown fox jumps on lazy dogs  

sample expected output:

  THE Quick Browen Fox Juns Over THE LASI DOG.  

It would be nice if the RegEx was applied every time the output was made. For example, the above input was given, once the RegEx was applied, the output could be:

  This QIKC was Browan Fox zoompus OVR were La Aji Dog  < / Pre> 

I know that setting up a replacement table would be easy (eg, 'x' => 'X', 'B' => 'b'), but this is not what I'm looking for .

I did a Google search for it and nothing came, though I know it has been done. I had the code (now lost) that did so.

perl in this work

Pearl-E '$ _ = "Quick Brown Fox jumps on lazy dogs "; / ([A-zA-Z]) / rand () & lt.5 UK ($ 1): LC ($ 1) / Ge; Print it several times ...

  • Thiq Quick Brova Fox Jumps Over LA AG Dog
  • Thaq Quick Braun Fox at Jumps Lozi Dog
  • The Quick Brown Fox Jumps OAVR Funny Dog
  • Quik Bruin Fox Juns Over Laugh Dogi
  • This Quick Brown Fox Jumps Over O T Hie Lazy Dog
  • Queck Brown Fox OAVR The Legacy Dog
  • KUK BRWN FOX Jumpy Over the Lazy Dogle
  • THE QUICK BROOVAN FOX JUMP OZAR LASY Dog

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -