The only difference being the kind of quotes used in my specific case.
If I am understanding correctly, the '\' is an escape character in the Replace dialog and everything else is treated as text. Are there any other escape characters for the replace? (I think I understand the search side of regex's better than I get the rules for the replace side).
THNX: I really appreciate it!
Idris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When trying to solve this regex problem -- I tried using an extra "\" in the replace to 'escape' the "\" before the "b" in the replace -- (\index{\\bf \1} -- but it still translated the \b into a BS resulting in "\index(\BSf <text>)
(Where BS = special character (backspace I think?)
Does anyone know how you could insert a literal "\b" into a replace, without tagging "\b" from the search, and just refferencing it in the replace? Basically, if "\b" was not in the original text -- how could I insert it, in a regex search/replace?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I don't understand how to use the regex search and replace. Perhaps an example will help me get the hang of it:
I have a text file with sequences of characters like
{\bf “The Dervish Lodge: Architecture, Art, and Sufism in Ottoman Turkey.”}
I would like to search for
\{\\bf “(.*?)”\}
and replace with
\index{\bf $1}
where '$1' represents what's in parens
basically I want to get rid of the quotes and index what's in brackets. How do I do this using the regex dialog?
Best
Idris
Try this
search
\{(\\bf) "(.*)"\}
replace
\index{\1 \2}
Basically - Take the "?" out -- and use \1 instead of $1 to reference
(I used ()'s around the \bf - because i was having trouble with the \b in the replace adding a BS instead of "\b")
Hi,
Thank you: the following works in my case:
search
\{(\\bf) “(.*)”\}
replace
\index{\1 \2}
The only difference being the kind of quotes used in my specific case.
If I am understanding correctly, the '\' is an escape character in the Replace dialog and everything else is treated as text. Are there any other escape characters for the replace? (I think I understand the search side of regex's better than I get the rules for the replace side).
THNX: I really appreciate it!
Idris
I was actually curous about this myself.
When trying to solve this regex problem -- I tried using an extra "\" in the replace to 'escape' the "\" before the "b" in the replace -- (\index{\\bf \1} -- but it still translated the \b into a BS resulting in "\index(\BSf <text>)
(Where BS = special character (backspace I think?)
Does anyone know how you could insert a literal "\b" into a replace, without tagging "\b" from the search, and just refferencing it in the replace? Basically, if "\b" was not in the original text -- how could I insert it, in a regex search/replace?
There's a regex FAQ at http://notepad-plus.sourceforge.net/uk/regExpList.php .
That's a great help, did not see that one before...
THNX
I