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 </nowiki></code> | | <code><nowiki>$1 </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 </nowiki></code> | |||
| Replace <code>! {{pipe}} </code> and <code>{{pipe}} {{pipe}} </code> with <code>! </code> and <code>{{pipe}} </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- | <nowiki />* Requires support for variable-width lookaheads and lookbehinds | ||
== See also == | == See also == |