NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[fixed] regular expression search/replace \1 not working?
Veteran

Joined: 30 Aug 2006
Posts: 116
Reply with quote
Ok, I just encountered an interesting situation, and I'm not sure if its a bug or just me not using the search and replace properly.

This is so specific I hope you can follow.

Say I have a string that looks like:

Code:
<a href="/homepage.html">


And I would like to run a regex based search and replace like this:

Find:

href=("|')/(\w*)

Replace with:

href=\1{$smarty.const.URL_PREFIX}\2

The result would be:

Code:
<a href=\1{$smarty.const.URL_PREFIX}homepage.html">


After fiddling around for a bit, it looks like the curly braces has something to do with it.

For instance the following works perfectly:

Find:

href=("|')/(\w*)

Replace with:

href=\1[$smarty.const.URL_PREFIX]\2

The result is:

Code:
<a href="[$smarty.const.URL_PREFIX]homepage.html">
View user's profileFind all posts by rudderSend private message
Veteran

Joined: 30 Aug 2006
Posts: 116
Reply with quote
Just an update: the Nusphere team seems to have fixed this within a day or so of me having asked about it (one of the newer builds). SWEET.
View user's profileFind all posts by rudderSend private message
[fixed] regular expression search/replace \1 not working?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic