Delete before & after
Posted: Mon Jun 02, 2008 2:48 pm
Hi, I have file with a few thousands lines of text. Each line contains a match to the following regular expression:
("................")
I want to delete all characters before & after the regular expression, leaving me with only the characters matching the regular express (one match per line). Is this possible? The number of characters before & after vary from line to line.
Thanks!
*** UPDATE ***
I figured out how to find what I need
.*("................")
OR
("................").*
Now I just need to figure out how to do a replace that preserves the ("................"). Obviously this doesn't work:
FIND: .*("................")
REPLACE: ("................")
How do I replace to preserve the original characters matching ("................")?
("................")
I want to delete all characters before & after the regular expression, leaving me with only the characters matching the regular express (one match per line). Is this possible? The number of characters before & after vary from line to line.
Thanks!
*** UPDATE ***
I figured out how to find what I need
.*("................")
OR
("................").*
Now I just need to figure out how to do a replace that preserves the ("................"). Obviously this doesn't work:
FIND: .*("................")
REPLACE: ("................")
How do I replace to preserve the original characters matching ("................")?