Replace a single regular
Posted: Mon May 07, 2012 6:02 am
Hello,
Tell me how I can replace a single regular expression other
a simple regular expression. I have got an example, a text file with lines
mask of search:
mask of replace:
Finally I get desired option for me
If the number of directory changes then it must have a different lenghth
mask of search: ? mask of replace: ?
then this filter should be changed each time
Have you got scheme of a regular expression that will allow
get this, same result
does not depend on the number of
directories in the chain.
Thank you.
Tell me how I can replace a single regular expression other
a simple regular expression. I have got an example, a text file with lines
Code: Select all
G:/1/gusi_lebedi/gisi_lebedi1.htm
G:/1/guravlj_tsaplja/guravlj_tsaplja.htm
G:/1/gribok_teremok/gribok_teremok.htm
Code: Select all
G:/([^"]+)/([^"]+)/([^"]+).htm
Code: Select all
G:/$1/$2/
Code: Select all
G:/1/gusi_lebedi/
G:/1/guravlj_tsaplja/
G:/1/gribok_teremok/
Code: Select all
G:/1/gusi_lebedi/../../gisi_lebedi1.htm
G:/1/guravlj_tsaplja/guravlj_tsaplja.htm
G:/1/gribok_teremok/../../../gribok_teremok.htm
then this filter should be changed each time
Have you got scheme of a regular expression that will allow
get this, same result
Code: Select all
G:/1/gusi_lebedi/
G:/1/guravlj_tsaplja/
G:/1/gribok_teremok/
directories in the chain.
Thank you.