Thanks! I apologize for inadvertently using curly brackets where I should have indicated parentheses. The four variations should have been:
(at12345)
(at12345(
)at12345(
)at12345)
The "at" is a constant. The number of numerals varies from two to five.
I modified your instructions as follows
([()])at[0-9][0-9][0-9][0-9]([()])
which gets replaced with @
Thanks again for pointing me in the right direction.
Now I have to figure out how to add a comma at the end of each line. Using $ works but, for some reason, skips every other line. I'll post a new topic if I can't figure it out.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm having trouble finding strings that begin and end with parentheses. For example, I want to be able to find:
{at12345}
(at12345(
}at12345}
}st12345{
where "12345" is a string of 2 to 5 numerical characters.
I want to replace the string with "@".
Thanks.
regular expression match
([{}()])[a-z][a-z][0-9][0-9][0-9][0-9][0-9]([{}()])
replace with
\1@\2
and then modify and repeat for 2, 3, and four digits instead of five
Thanks! I apologize for inadvertently using curly brackets where I should have indicated parentheses. The four variations should have been:
(at12345)
(at12345(
)at12345(
)at12345)
The "at" is a constant. The number of numerals varies from two to five.
I modified your instructions as follows
([()])at[0-9][0-9][0-9][0-9]([()])
which gets replaced with @
Thanks again for pointing me in the right direction.
Now I have to figure out how to add a comma at the end of each line. Using $ works but, for some reason, skips every other line. I'll post a new topic if I can't figure it out.
Find:
([()])at(\d+[()])
Replace:
\1@\2
Replaces the at followed by any number of digits.
Take a look at these similar messages, if you didn't already:
"how to append lines with a comma or other characters"
http://sourceforge.net/forum/message.php?msg_id=4833798
Are you trying to replace the at=@ and appending the comma at the same time?
Or do you have different linebreaks in your document?
This is the intended link to the complete thread, allowing easily reading all the messages with one page view:
http://sourceforge.net/forum/forum.php?thread_id=1967758&forum_id=331754