Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2013-12-29 08:56
Flavor·ECMAScript (JavaScript)

/
((?:\<[^<>]+\>\s?)?)([:]\w+(?!\w*[;]))((?:\s?\<\/[^<>]+\>)?)((?:(?:.(?!\1\2\3))*.){2})\1\2\3
/
Open regex in editor

Description

This regex replace the second tag content which has the prefix ":". If you want to replace the third, just increase the statement {1} to {2}, and so go on.

Submitted by Caio Oliveira