Replace the 1st (or 3rd) INSTANCE OF / on a line
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Replace the 1st (or 3rd) INSTANCE OF / on a line
Hi guys. I'm trying to locate either the 1st Instance or the 3rd Instance of / on a line, and replace the character immediately following with a carrier return (\n).
2 EXAMPLES (both block left)
- - - - - - - - - - - - - - - - - - - - - - - - - -
www.1111.com/aaaaaaa.OOOOO.html
becomes
www.1111.com/(carrier return)
aaaaaaa.OOOOO.html
- - - - - - - - - - - - - - - - - - - - - - - - - -
http://www.2222.com/bbbbbbb.html
becomes
http://www.222.com/(carrier return)
bbbbbbb.html
Thanks everyone.
2 EXAMPLES (both block left)
- - - - - - - - - - - - - - - - - - - - - - - - - -
www.1111.com/aaaaaaa.OOOOO.html
becomes
www.1111.com/(carrier return)
aaaaaaa.OOOOO.html
- - - - - - - - - - - - - - - - - - - - - - - - - -
http://www.2222.com/bbbbbbb.html
becomes
http://www.222.com/(carrier return)
bbbbbbb.html
Thanks everyone.
Trump.
Jesus wept.
Jesus wept.
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
Do you really want to find the last slash on the line?
Do you want to insert a newline sequence (either Windows style CR,LF (carriage return, line feed) or Unix style LF (line feed)), rather than a lone CR?
Do you want to insert a newline, as your examples (ignoring the typo) indicate, rather than replace anything with one.
If so, try this:
Do you want to insert a newline sequence (either Windows style CR,LF (carriage return, line feed) or Unix style LF (line feed)), rather than a lone CR?
Do you want to insert a newline, as your examples (ignoring the typo) indicate, rather than replace anything with one.
If so, try this:
Find what: ^.*/
Replace with: \0\n
Hi Ben and thank you once again.
I'm modifying my original request to search every FF Bookmark entry containing the line example:
and insert a newline (\n) immediately after the first > that follows the word MODIFIED (for which there is only one instance per bookmark). The result should look like this when I look at it in Textpad:
I realize the output is illegal for HTML purists but this is for my own private use. 
Thanks Ben.
I'm modifying my original request to search every FF Bookmark entry containing the line example:
Code: Select all
<DT><H3 ADD_DATE="1412102482" LAST_MODIFIED="1412181470">WikiBOOKS & WikiPEDIA BOOKS</H3>Code: Select all
<DT><H3 ADD_DATE="1412102482" LAST_MODIFIED="1412181470">
WikiBOOKS & WikiPEDIA BOOKS</H3>Thanks Ben.
Trump.
Jesus wept.
Jesus wept.
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
It does work.
I see you are using a very old version of TextPad, whose regex support is very different from and very much weaker than the current version's. Much that can be done in the current version cannot be done in previous versions.
Try this:
I see you are using a very old version of TextPad, whose regex support is very different from and very much weaker than the current version's. Much that can be done in the current version cannot be done in previous versions.
Try this:
I cannot test this.Find what: MODIFIED[^>]*>
Replace with: \0\n
Ah. Ben, how stable is the latest version? I ask because when I attempted using a newer version many months ago it kept crashing.ben_josephs wrote:I see you are using a very old version of TextPad, whose regex support is very different from and very much weaker than the current version's. Much that can be done in the current version cannot be done in previous versions. I cannot test this.
Trump.
Jesus wept.
Jesus wept.
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm