REGULAR EXPRESSIONS

Pattern

Input


What is Regex?

Regular expressions are used to represent the language of finite automata. Regular Expression is an expression that can be use in many programming languages and finds sections that match certain rules in numeric and string content.

Where to Use?

Many programming languages, operating system commands, database queries and search applications uses Regular Expression. We are going to use it on HTML inputs for specifical input type like Social ID, phone number, email, credit card number and validation date etc.

How to Use?

Regex is abbreviation of the Regular Expression. Regular Expression is an expression that can be use in many programming languages and finds sections that match certain rules in numeric and string content.

Token Description Sample
* Repeating 0 or more of previous token. a* --> ,a,aa,aaa
+ Repeating 1 or more of previous token. a+ --> a,aa,aaa
() Making group. (aa)+ --> aa,aaaa,aaaaaa
[] One of the characters within the specified range. [1-4] --> 1,2,3 or 4
[^] Except One of the characters within the specified range. [^1-4] --> Except 1,2,3 and 4
\s Space character. \s+ --> , ,
\S Except space character. \S+ --> abc,123,a1b2c3
\d All numeric characters. \d+ --> 1,32,512,1024
\D Except all numeric characters. \D+ --> a,bc,def,qwerty
\w All characters used in words. \w+ --> Gokce
{} Number of previous characters or groups to repeat. [1-4]{3} --> 111,234,134