Regular Expressions 101

Sponsors

Library entries

9
pcre

only numbers

A string with only numbers in
Submitted by Gotts - 7 years ago
10
pcre

remove comments from php code

no description available
Submitted by anonymous - 7 years ago
11
pcre

Codice fiscale

Check "codice fiscale"
Submitted by Luca - 7 years ago
12
pcre

Match Gmail Email

Match Gmail Email
Submitted by Óscar Enríquez - 8 years ago
16
pcre

Alphanumeric Regex

no description available
Submitted by Deepan - 7 years ago
16
pcre

IPv4

no description available
Submitted by robwa - 7 years ago
16
pcre

Cron schedule

Validate cron lines (even the ones commented out)
Submitted by anonymous - 6 years ago

Cron schedule

Vote

16

Regular Expression
pcre

~
^\s*\#?\s*(?:(?:(?'mins'[0-5]?\d)(?:[-,](?&mins))*)|\*)(?:/\d{1,2})?\s+(?:(?:(?'hours'(?:2[0-3]|[01]?\d))(?:[-,](?&hours))*)|\*)(?:/\d{1,2})?\s+(?:(?:(?'dmon'(?:3[01]|[12]?\d))(?:[-,](?&dmon))*)|\*)(?:/\d{1,2})?\s+(?:(?:(?'mon'(?:1[0-2]|[1-9]))(?:[-,](?&mon))*)|\*)(?:/\d{1,2})?\s+(?:(?:(?'dow'(?:[0-6]|\b(?:mon|tue|wed|thu|fri|sat|sun)\b))(?:[-,](?&dow))*)|\*)(?:/\d{1,2})?\s+.+$
~

Description

Loading markdown...
Submitted by anonymous - 6 years ago