Please help me very urgent regex in edit plus..

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
anirbanb2004
Forum Newbie
Posts: 23
Joined: Sun Oct 15, 2006 4:21 pm

Please help me very urgent regex in edit plus..

Post by anirbanb2004 »

I am trying a simple regular expression to find and replace following in any document. 'm using EditPlus.

String to find:
request("xxxxx")

where xxxxx can be anything; so white space request(" anything ")

and to replace it with
sanatize(request("xxxxx"))
where xxxxx can be anything; so white space sanatize(request(" anything "))
Please help it is very urgent.. :(
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Simple? How simple? You can just do a regular find/replace and find "request(", replace it with "sanitize(request(" and add the extra parentheses at the end. Or, better yet, make sanitize() a part of the request() method.
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

Search:

Code: Select all

(request\(".+"\))
Replace:

Code: Select all

sanatize(\1)
Note that you've misspelled sanitize.
anirbanb2004
Forum Newbie
Posts: 23
Joined: Sun Oct 15, 2006 4:21 pm

Post by anirbanb2004 »

Thanks
Post Reply