Regex search in Dreamweaver

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

Moderator: General Moderators

Post Reply
tr3online
Forum Newbie
Posts: 16
Joined: Sat Jan 24, 2009 8:02 pm

Regex search in Dreamweaver

Post by tr3online »

Hi guys,
I have a bunch of *.txt files that contain a lot of data I'm looking to upload to my database.
Unfortunately, the original way I ran my database used a somewhat deprecated method of identifying things.

The actual data I want is labeled as test2=, but there is a test1=[#]& following that.
ie: test1=63&test2=[data] , test1=40&test2=[data] , test1=13&test2=[data]

Can you guys recommend me a regex search string so I can find any replace all the test1=[#]&test2= and rename it to just kashi= please?

Any input would be much appreciated :D

Thanks!

Tre
User avatar
prometheuzz
Forum Regular
Posts: 779
Joined: Fri Apr 04, 2008 5:51 am

Re: Regex search in Dreamweaver

Post by prometheuzz »

So, after the test1=... there are always numbers?
You could use preg_replace(...) and replace the following pattern:

Code: Select all

test1=\d+&test2=
'\d' means a (numeric) digit and '+' means one or more.
Post Reply