- Save Regexctrl+s
- Go to library entry

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

- Match
- Substitution
- List
- Unit Tests (8)

Sponsor

Jamstack at Scale

/

^P(\d+([,\.]\d+)?Y)?(\d+([,\.]\d+)?M)?(\d+([,\.]\d+)?D)?(T(\d+([,\.]\d+)?H)?(\d+([,\.]\d+)?M)?(\d+([,\.]\d+)?S)?)?$

/

gm

^ asserts position at start of a line

P matches the character P with index 80_{10} (50_{16} or 120_{8}) literally (case sensitive)

1st Capturing Group

(\d+([,\.]\d+)?Y)?

? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)

\d

matches a digit (equivalent to [0-9])+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)

2nd 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 44_{10} (2C_{16} or 54_{8}) literally (case sensitive)

\. matches the character . with index 46_{10} (2E_{16} or 56_{8}) literally (case sensitive)

\d

matches a digit (equivalent to [0-9])+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)

Y matches the character Y with index 89_{10} (59_{16} or 131_{8}) literally (case sensitive)

3rd Capturing Group

(\d+([,\.]\d+)?M)?

? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)

\d

matches a digit (equivalent to [0-9])+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)

4th Capturing Group

([,\.]\d+)?

Match a single character present in the list below

[,\.]

, matches the character , with index 44_{10} (2C_{16} or 54_{8}) literally (case sensitive)

\. matches the character . with index 46_{10} (2E_{16} or 56_{8}) literally (case sensitive)

\d

matches a digit (equivalent to [0-9])M matches the character M with index 77_{10} (4D_{16} or 115_{8}) literally (case sensitive)

5th Capturing Group

(\d+([,\.]\d+)?D)?

\d

matches a digit (equivalent to [0-9])6th Capturing Group

([,\.]\d+)?

Match a single character present in the list below

[,\.]

, matches the character , with index 44_{10} (2C_{16} or 54_{8}) literally (case sensitive)

\. matches the character . with index 46_{10} (2E_{16} or 56_{8}) literally (case sensitive)

\d

matches a digit (equivalent to [0-9])D matches the character D with index 68_{10} (44_{16} or 104_{8}) literally (case sensitive)

7th Capturing Group

(T(\d+([,\.]\d+)?H)?(\d+([,\.]\d+)?M)?(\d+([,\.]\d+)?S)?)?

T matches the character T with index 84_{10} (54_{16} or 124_{8}) literally (case sensitive)

8th Capturing Group

(\d+([,\.]\d+)?H)?

\d

matches a digit (equivalent to [0-9])9th Capturing Group

([,\.]\d+)?

Match a single character present in the list below

[,\.]

, matches the character , with index 44_{10} (2C_{16} or 54_{8}) literally (case sensitive)

\. matches the character . with index 46_{10} (2E_{16} or 56_{8}) literally (case sensitive)

\d

matches a digit (equivalent to [0-9])H matches the character H with index 72_{10} (48_{16} or 110_{8}) literally (case sensitive)

10th Capturing Group

(\d+([,\.]\d+)?M)?

\d

matches a digit (equivalent to [0-9])11th Capturing Group

([,\.]\d+)?

Match a single character present in the list below

[,\.]

, matches the character , with index 44_{10} (2C_{16} or 54_{8}) literally (case sensitive)

\. matches the character . with index 46_{10} (2E_{16} or 56_{8}) literally (case sensitive)

\d

matches a digit (equivalent to [0-9])M matches the character M with index 77_{10} (4D_{16} or 115_{8}) literally (case sensitive)

12th Capturing Group

(\d+([,\.]\d+)?S)?

\d

matches a digit (equivalent to [0-9])13th Capturing Group

([,\.]\d+)?

Match a single character present in the list below

[,\.]

, matches the character , with index 44_{10} (2C_{16} or 54_{8}) literally (case sensitive)

\. matches the character . with index 46_{10} (2E_{16} or 56_{8}) literally (case sensitive)

\d

matches a digit (equivalent to [0-9])S matches the character S with index 83_{10} (53_{16} or 123_{8}) literally (case sensitive)

$ asserts position at the end of a line

Global pattern flags

g modifier: **g**lobal. All matches (don't return after first match)

m modifier: **m**ulti line. Causes ^ and $ to match the begin/end of each line (not only begin/end of string)

Your regular expression does not match the subject string.

No Match

/

/

gm

Please wait while the app is loading...