Regular Expressions 101

  • Python
  • Match
0

Regular Expression

r"
(?P<general>(?P<first>\d{1,3}[\.,']?\d{1,3}?)[xX](?P<second>\d{1,3}[\.,']?\d{1,3}?))
"
gm

Description

Getting sizes, formatted as in x or x. It supports up to 3 digits, with an additional, optional, decimal digit. The decimal point could be a comma, a point or even an apostrophe ( ' ).

Submitted by Hermes