Tutorial
Tools & Languages
Examples
Reference
Matching HTML Tag Pairs
<
(
[A-Z]
[A-Z0-9]
*
)
[^>]
*
>
.
*?
</
\1
>
Options: dot matches newline; case insensitive
Match the character "<" literally
Match the regular expression below and capture its match into backreference number 1
Match a single character out of the list: in the range between A and Z
Match a single character out of the list: in the range between A and Z, or in the range between 0 and 9
Between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Match a single character not present in the list: one of the characters ">"
Between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Match the character ">" literally
Match any single character
Between zero and unlimited times, as few times as possible, expanding as needed (lazy)
Match the characters "</" literally
Match the same text as most recently matched by backreference number 1
Match the character ">" literally
Welcome
Tutorial
Tools and Languages
Examples
Reference
About This Site
Download and Print