Regular Expressions 101

Save & Share

  • Save Regex
    ctrl+s
  • Update Regex
    ctrl+⇧+s

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8

Function

  • Match
  • Substitution
  • List
  • Unit Tests
"
<span\b[^>]*>(?# Открывающий span с любыми атребутами )\s*(?# Пробелы )(\-?\d+(?:[\.\,]\d+)?)(?# Число )\s*(?# Пробелы )<\/span>(?# Закрывающий span)
"
gus
<span
matches the characters <span literally (case sensitive)
\b assert position at a word boundary: (^\w|\w$|\W\w|\w\W)
Match a single character not present in the list below
[^>]
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
> matches the character > with index 6210 (3E16 or 768) literally (case sensitive)
> matches the character > with index 6210 (3E16 or 768) literally (case sensitive)
Comment: Открывающий span с любыми атребутами
\s
matches any kind of invisible character (equivalent to [\p{Z}\h\v])
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Comment: Пробелы
1st Capturing Group
(\-?\d+(?:[\.\,]\d+)?)
\-
matches the character - with index 4510 (2D16 or 558) literally (case sensitive)
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
\d
matches a digit zero through nine in any script except ideographic scripts (equivalent to \p{Nd})
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
Non-capturing group
(?:[\.\,]\d+)?
? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)
Match a single character present in the list below
[\.\,]
\. matches the character . with index 4610 (2E16 or 568) literally (case sensitive)
\, matches the character , with index 4410 (2C16 or 548) literally (case sensitive)
\d
matches a digit zero through nine in any script except ideographic scripts (equivalent to \p{Nd})
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)
Comment: Число
\s
matches any kind of invisible character (equivalent to [\p{Z}\h\v])
* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Comment: Пробелы
< matches the character < with index 6010 (3C16 or 748) literally (case sensitive)
\/ matches the character / with index 4710 (2F16 or 578) literally (case sensitive)
span>
matches the characters span> literally (case sensitive)
Comment: Закрывающий span
Global pattern flags
g modifier: global. All matches (don't return after first match)
u modifier: unicode. Make \w, \W, \b, \B, \d, \D, \s and \S perform matching with Unicode semantic (redundant in Python 3)
s modifier: single line. Dot matches newline characters
Your regular expression does not match the subject string.

Regular Expression
No Match

r"
"
gus

Test String

Substitution

Processing...