Thread: Regex examples
View Single Post
Old 07-03-2012, 04:18 AM   #101
mrjoeyman
Junior Member
mrjoeyman began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2012
Device: Kindle Fire
reverse linking time consuming woes

<a href="../Text/notes.html#scrip1" id="backscrip1">This text is a link</a>

The above is some code in my file that I use to reverse link, or tag/anchor, whatever they call it. You click on a link in one file (in this case clicking on the text "This text is a link" would take you to the "../Text/notes.html file, where another link is designated as "scrip1", with the previous link "This text is a link" was designated as "backscrip1". So they go back and forth. When there are hundreds of reverse links, it take me a short time to list the main code ie...

<a href="../Text/scriptures.html#scrip1" id="backscrip1">This text is a link</a>
<a href="../Text/scriptures.html#scrip1" id="backscrip1">This text is a link</a>
<a href="../Text/scriptures.html#scrip1" id="backscrip1">This text is a link</a>
<a href="../Text/scriptures.html#scrip1" id="backscrip1">This text is a link</a>
<a href="../Text/scriptures.html#scrip1" id="backscrip1">This text is a link</a>

but now I have to go back and change the second occurrence of the linking code to "2" then "3" then "4", ie...

<a href="../Text/scriptures.html#scrip1" id="backscrip1">This text is a link</a>

<a href="../Text/scriptures.html#scrip2" id="backscrip2">This text is a link</a>

<a href="../Text/scriptures.html#scrip3" id="backscrip3">This text is a link</a>

<a href="../Text/scriptures.html#scrip4" id="backscrip4">This text is a link</a>

....you get the idea.

Is there a way to use the find and replace in such a way that it would search for this code and bump up the number for each occurrence, so I won't have to manually find each one and put in each number separately myself?

mrjoeyman is offline   Reply With Quote