Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Preserve Case in Regexp

by graff (Chancellor)
on Mar 17, 2004 at 03:17 UTC ( #337207=note: print w/replies, xml ) Need Help??


in reply to Preserve Case in Regexp

Given that perl won't do exactly what you want, perhaps a reasonable compromise is to have it provide a fallback that's easy enough.

Suppose you use your favorite text editor just to create a list of the mixed-case name replacements -- e.g. the self-respecting unix guru would do something like this:

$ cat > ClRename.sed s/OldClass/NewClass/g s/RedClass/BlueClass/g s/BadClass/GoodClass/g ... ^D
Now create a version of the list that includes the downcased names along with the original mixed-case ones:
perl -pe 'print lc' ClRename.sed > flAndClRename.sed
The latter output file is now suitable for use as a script (for 'perl -pi.bak' or 'sed -f'). Not the most efficient algorithm, perhaps, but usable.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://337207]
help
Chatterbox?
[Corion]: A fresh module escapes into the morning twilight of Github. HTTP::Generator, produces cartesian products of your HTTP parameters to create more HTTP requests
[Corion]: But it still needs lots of documentation and more tests before I can release it. Also adapters to turn the data structure into HTTP::Request objects and Dancer::Request, Mojo::Request and Plack::Request

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2017-01-20 11:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.