User:Danwe/regex

This page contains some of my regular expressions. I just put them here to find them whenever the need arises.

JavaScript
Matches everything until some word (in this case ) and everything behind that word and stores those parts as backrefs. Nothing fancy, I just keep forgetting the syntax of look around assertions and this is probably the one most frequently used by me.

So here are the different look around asertions anyhow (source, javascriptkit.com):

lookaheads:
 * matches only if there is a following pattern in input.
 * matches only if there is not a following pattern in input.

lookbehinds - not supported in JS, but the web might help with that

This one is supposed to replace all attributes of all DOM nodes:

PHP
From Semantic Expressiveness extension. Matches a certain DOM structure, using recursive expressions. Used in ExpressiveStringPieceSQResult class.