Skip to main content

Regex Examples

What DidFindReplace
-4replace [md] links with <abbr>\[([^+\]]+)\](\([^"]+")([^"]+)"\)<abbr title="$3">$1</abbr>
-3find and fix img tags without />(<input[^>]+)>$1 />
-2markdown links -> text\[([^\]]+)\]\([^\)]+\)$1
-1Nested tags<div class="history">(?:[^<\r]*(?:<(?!/div>)[^<]*)*</div>){15}
0Wrap between """([^"]+)"$1
1Wraps with Italic/Bold- ([^\\:]+)- ***$1***
2From Italic/Bold to Bold\*{3}(.*)\*{3}**$1**
3Adds to ``` jsx(```)(\n.)$1jsx$2
4Removes double spaces`\s(\s.)`$1
5Deletes unnessesary \n\n(\n```\n\n)$1
6Replaces two empty links with one non-empty one\[\]\(.*\n.*[^\(]+.(.*[^\)])\)(.*)$2\n\n[$2]($1
7See above, but replace with <a>\[\]\(.*\n.*[^\(]+.(.*[^\)])\)(.*)$2\n\n$2 <a href='$2' class='external'>$1</a>
8Replaces markdown link with html link\[.*\/\/([^\/]+)\/.*\]\((.*)\)<a href='$2' class='external'>$1</a>

9 Removes numbers at start of the lines

and removes commented lines; removes empty lines

I did this for the poorly formatted code blocks in this tutorial docs.microsoft.com: Using React and building a web site on Azure.

<!-.*\n|^ *\d[:\.] *\n|^.*\d[:\.] *|//.*//.*\n
1: // index.js //
2:
3: var React = require('react');
4: var ReactDOM = require('react-dom');
5: require('./index.css');