User:ArrowHead294/Regex snippets

These are some regular expressions I use for formatting purposes:

Pattern Replace by Purpose
^(?:\+|-|\x{2212})?(?:(?:\d{1,3}?(?:\,\d{3})*|\d+)\.?\d*|\d*\.?\d+)(?:[Ee][+-]?\d+)?$ N/A Match a number
(?<!(<[Nn][Oo][Ww][Ii][Kk][Ii]>[^\n]*)|\{|\})(?<=\n)(\||\!)\s*(?!-|<\/[Nn][Oo][Ww][Ii][Kk][Ii]>|\{|\}) \1  Space out pipe characters and header separators in tables (one cell per line)*
(?<!(?:<[Nn][Oo][Ww][Ii][Kk][Ii]>[^\n]*(?=<\/[Nn][Oo][Ww][Ii][Kk][Ii]>)|\{|\}))[^\S\r\n]*(\|\|\|?|!!!?)[^\S\r\n]*(?!-|[^\n]*<\/[Nn][Oo][Ww][Ii][Kk][Ii]>(?=<\/[Nn][Oo][Ww][Ii][Kk][Ii]>)|\{|\})  \1  Space out pipe characters and header separators in tables (entire row per line)*

* Requires support for variable-length lookaheads and lookbehinds