- 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

Sponsor

Jamstack at Scale

/

^\[([\d]{1,2}-[\w]{3,9}-[\d]{4}\s+[\d]{2}:[\d]{2}:[\d]{2}\s+[A-Z]{3,4})\]\s((?s).+?)(?=(?:^\[.+\])|\Z)

/

gm

^ asserts position at start of a line

\[ matches the character [ with index 91_{10} (5B_{16} or 133_{8}) literally (case sensitive)

1st Capturing Group

([\d]{1,2}-[\w]{3,9}-[\d]{4}\s+[\d]{2}:[\d]{2}:[\d]{2}\s+[A-Z]{3,4})

Match a single character present in the list below

[\d]

{1,2} matches the previous token between 1 and 2 times, as many times as possible, giving back as needed (greedy)

\d matches a digit (equivalent to [0-9])

- matches the character - with index 45_{10} (2D_{16} or 55_{8}) literally (case sensitive)

Match a single character present in the list below

[\w]

{3,9} matches the previous token between 3 and 9 times, as many times as possible, giving back as needed (greedy)

\w matches any word character (equivalent to [a-zA-Z0-9_])

- matches the character - with index 45_{10} (2D_{16} or 55_{8}) literally (case sensitive)

Match a single character present in the list below

[\d]

{4} matches the previous token exactly 4 times

\d matches a digit (equivalent to [0-9])

\s

matches any whitespace character (equivalent to [\r\n\t\f\v ])+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)

Match a single character present in the list below

[\d]

{2} matches the previous token exactly 2 times

\d matches a digit (equivalent to [0-9])

: matches the character : with index 58_{10} (3A_{16} or 72_{8}) literally (case sensitive)

Match a single character present in the list below

[\d]

{2} matches the previous token exactly 2 times

\d matches a digit (equivalent to [0-9])

: matches the character : with index 58_{10} (3A_{16} or 72_{8}) literally (case sensitive)

Match a single character present in the list below

[\d]

{2} matches the previous token exactly 2 times

\d matches a digit (equivalent to [0-9])

\s

matches any whitespace character (equivalent to [\r\n\t\f\v ])+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)

Match a single character present in the list below

[A-Z]

{3,4} matches the previous token between 3 and 4 times, as many times as possible, giving back as needed (greedy)

A-Z matches a single character in the range between A (index 65) and Z (index 90) (case sensitive)

\] matches the character ] with index 93_{10} (5D_{16} or 135_{8}) literally (case sensitive)

\s matches any whitespace character (equivalent to [\r\n\t\f\v ])

2nd Capturing Group

((?s).+?)

(?s)

match the remainder of the pattern with the following effective flags: gmss modifier: **s**ingle line. Dot matches newline characters

.

matches any character +? matches the previous token between one and unlimited times, as few times as possible, expanding as needed (lazy)

Positive Lookahead

(?=(?:^\[.+\])|\Z)

Assert that the Regex below matches

1st Alternative

(?:^\[.+\])

Non-capturing group

(?:^\[.+\])

^ asserts position at start of a line

\[ matches the character [ with index 91_{10} (5B_{16} or 133_{8}) literally (case sensitive)

.

matches any character (except for line terminators)+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy)

\] matches the character ] with index 93_{10} (5D_{16} or 135_{8}) literally (case sensitive)

2nd Alternative

\Z

\Z asserts position at the end of the string, or before the line terminator right at the end of the string (if any)

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.Try launching the debugger to find out why.

/

/

gm

Please wait while the app is loading...