views:

5

answers:

1

Lets say I have a bunch of areas like:

joe is punching jim

joe is kicking jim

joe is spitting on jim.

and I wanted to find every case with joe is _ jim and completely change the order around. normally I would just do a wilcard search, and search and replace "joe is [^"]* jim". but what if i wanted to KEEP whatever the wildcard was and simply rearrange the words? (kinda like using [^"] as a variable in the replace window).

basically what I want to do is search and replace "joe is [^"]* jim" with "jim is [^"]* joe" (without "[^"]*" literally appearing as the replaced text). I know someone will probably say

"why don't you just do search and replaces for both jim and joe, and ignore the [^"]* ?"

well if the wildcard could be stored as a variable in the search and replace, then you can do what would take multiple steps in 1.

if not dreamweaver, are there any other coding environments that will let you do this?

A: 

Search for joe is ([^<]*) jim and replace with jim is $1 joe.

If you have several ([^<]*) wildcards, you can refer to all of them with $1, $2, $3...

Found it here.

lime