View Single Post
Old 12-20-2022, 12:24 AM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,417
Karma: 169098492
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Tex2002ans View Post
Search: <a href="[^"]+" title="wikilink">
Replace: <--- PUT BLANK/NOTHING HERE.

- - -

In Plain English, what does this regex do?

There's 3 key parts of the Search:

1. <a href="
  • = Look for the beginning of the <a> link.

2. [^"]+
  • = Look for 1 OR MORE "any character that ISN'T a double quote".
  • In Regex-speak, the symbols:
    • [] = Anything inside these brackets? "Look for THIS LIST OF CHARACTERS in this spot!"
    • The ^ sign is special, and says "Hey, you see the characters inside the brackets? Find anything that's NOT these!"
    • The + sign says "Look for 1 OR MORE of the previous thing."

3. " title="wikilink">
  • = Look for the rest of that <a> link.

Replace with:

NOTHING!
Sorry to disagree, but I would suggest replacing the <a href..."wikilink"> with <a> otherwise you'll be hunting down and replacing all the </a>s that have been orphaned. After the search/replace, I'd use DiapDealer's TagMechanic to remove the naked <a>whatever</a> pairs.
DNSB is online now   Reply With Quote