wonder if anyone knows if its possible to use regular expressions on both the find and the replace element. In short if i want to find all occurrences of: £ [0-9] million where [0-9] is any number in that set and replace only the £ sign to something else, can it be done. I dont see how the replace element can be specified to only replace the £ with say a $ and leave the number part untouched.
lucy24
7:56 pm on May 12, 2011 (gmt 0)
You have to capture the number in the "find" part: ([0-9]+) with + to allow for inflation ;)
and then call it $1 in the "replace" part.
santapaws
8:13 am on May 13, 2011 (gmt 0)
tx but i cant get this to work. how exactly should the $1 be written, ($1)? well ive tried all combos but none work, i.e. [$1] , ([$1]), ([0-9]$1) etc. :(
lucy24
10:00 am on May 13, 2011 (gmt 0)
No, no, it's just $1.
Parentheses mean "hang on to this text". $1 (and $2, $3 and so on if you're being fancy) mean "now spit it out again".
For example-- pulling something out of my own htaccess-- in