Regular expressions - course

Regular expressions (Regular Expression) It's a text mode , Including ordinary characters ( For example ,a To z Letters between ) And special characters ( be called " Metacharacter ").

Regular expressions use a single string to describe 、 Matches a series of strings that match a syntactic rule .

Regular expressions are cumbersome , But it's powerful , After learning the application, you will not only improve your efficiency , It will bring you an absolute sense of achievement . Just read this tutorial carefully , Add some reference when applying , Mastering regular expressions is not a problem .

Many programming languages support string operations using regular expressions .

Now start learning regular expressions !

example

The following example is from the string str Find the number in :

example

From the string str Extract the contents of the digital part ( Match once ):

var str = " abc123def " ; var patt1 = / [ 0 - 9 ] +/; document . write ( str . match ( patt1 ) ) ;

The text marked below is the matching expression obtained :

123

Give it a try »

Content list

Other related tools