User:ArrowHead294/Regex snippets: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 18: Line 18:
| <code><nowiki>$1&nbsp;</nowiki></code>
| <code><nowiki>$1&nbsp;</nowiki></code>
| Space out pipe characters and header separators in tables (one cell per line)*
| Space out pipe characters and header separators in tables (one cell per line)*
|-
| <code><nowiki>(?<=\n)(\||!)[^\S\r\n]*\|?[^\S\r\n]*(?!-|\})</nowiki></code>
| <code><nowiki>$1&nbsp;</nowiki></code>
| Replace <code>!&nbsp;{{pipe}}&nbsp;</code> and <code>{{pipe}}&nbsp;{{pipe}}&nbsp;</code> with <code>!&nbsp;</code> and <code>{{pipe}}&nbsp;</code>, respectively
|-
|-
| <code><nowiki>(?<=\[\[|\|)(\d+[Ll])\s*(\d+[Ss])(?=\]\]])?(?!\s)</nowiki></code>
| <code><nowiki>(?<=\[\[|\|)(\d+[Ll])\s*(\d+[Ss])(?=\]\]])?(?!\s)</nowiki></code>
Line 31: Line 35:
| Standalone fractions with single-digit numerators and denominators can be done using {{tlx|frac}} or {{tlx|sfrac}} and don't need to be TeXified
| Standalone fractions with single-digit numerators and denominators can be done using {{tlx|frac}} or {{tlx|sfrac}} and don't need to be TeXified
|}
|}
<nowiki />* Requires support for variable-length lookaheads and lookbehinds
<nowiki />* Requires support for variable-width lookaheads and lookbehinds


== See also ==
== See also ==