Regular Expressions 101

@regex101
Donate
Sponsor
Contact
Bug Reports & Feedback
Wiki
Whats new?

Save & Share

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

Flavor

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

Function

  • Match
  • Substitution
  • List
  • Unit Tests
/
\w\s\d\s[01][0-9]:[0-5][0-9]:[0-5][0-9]\s[a-z]\skernel:\smartian\ssource\s\d\.\d\.\d\.\d\sfrom\s\d\.\d\.\d\.\d,\son\sdev\s\w\n.
/
gm
\w
matches any word character (equivalent to [a-zA-Z0-9_])
{3} matches the previous token exactly 3 times
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
\d
matches a digit (equivalent to [0-9])
{0,2} matches the previous token between 0 and 2 times, as many times as possible, giving back as needed (greedy)
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
Match a single character present in the list below
[01]
01 matches a single character in the list 01 (case sensitive)
Match a single character present in the list below
[0-9]
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
: matches the character : literally (case sensitive)
Match a single character present in the list below
[0-5]
0-5 matches a single character in the range between 0 (index 48) and 5 (index 53) (case sensitive)
Match a single character present in the list below
[0-9]
0-9 matches a single character in the range between 0 (index 48) and 9 (index 57) (case sensitive)
: matches the character : literally (case sensitive)
Match a single character present in the list below
[0-5]
Match a single character present in the list below
[0-9]
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
Match a single character present in the list below
[a-z]
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
kernel: matches the characters kernel: literally (case sensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
martian matches the characters martian literally (case sensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
source matches the characters source literally (case sensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
\d
matches a digit (equivalent to [0-9])
\. matches the character . literally (case sensitive)
\d
matches a digit (equivalent to [0-9])
\. matches the character . literally (case sensitive)
\d
matches a digit (equivalent to [0-9])
\. matches the character . literally (case sensitive)
\d
matches a digit (equivalent to [0-9])
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
from matches the characters from literally (case sensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
\d
matches a digit (equivalent to [0-9])
\. matches the character . literally (case sensitive)
\d
matches a digit (equivalent to [0-9])
\. matches the character . literally (case sensitive)
\d
matches a digit (equivalent to [0-9])
\. matches the character . literally (case sensitive)
\d
matches a digit (equivalent to [0-9])
, matches the character , literally (case sensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
on matches the characters on literally (case sensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
dev matches the characters dev literally (case sensitive)
\s matches any whitespace character (equivalent to [\r\n\t\f\v ])
\w
matches any word character (equivalent to [a-zA-Z0-9_])
\n matches a line-feed (newline) character (ASCII 10)
.
matches any character (except for line terminators)
Global pattern flags
g modifier: global. All matches (don't return after first match)
m modifier: multi 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.

Regular Expression
No Match

/
/
gm

Test String