Quote:
Originally Posted by aknight2015
[...] 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:
- - -
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:
Quote:
Originally Posted by aknight2015
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.