View Single Post
Old 12-20-2022, 12:14 AM   #4
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by aknight2015 View Post
[...] to remove links like <a href="13th_Black_Crusade" title="wikilink"> with nothing, or a space if needed.
Search: <a href="[^"]+" title="wikilink">
Replace: <a>

- - -

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:
  • A blank <a>

- - -

Before:

Code:
<a href="13th_Black_Crusade" title="wikilink">
<a href="14th_Black_Crusade" title="wikilink">
<a href="15th_Black_Crusade" title="wikilink">
<a href="BlahBlahBlah" title="wikilink">
After:


Code:
<a>
<a>
<a>
<a>
Quote:
Originally Posted by aknight2015 View Post
I've tried reading the documentation about Regex, and it's all gibberish to me. I have no idea what each symbol means or does and the guides I've tried to read approaches the subject as if I'm familiar with similar languages. I just need to know what I can type, and what each things means/represents
See my recent post from last month:

I did step-by-step breakdowns on some Regex, plus I linked to a ton of my previous posts about the subject.

Many of my MobileRead topics even have color-coded regex, so you can see which piece does what.

Last edited by Tex2002ans; 12-20-2022 at 06:54 AM.
Tex2002ans is offline   Reply With Quote