>> English << | česky | Deutsch | Español ZVON > Tutorials > Regular Expressions Tutorial
>> Example 21 << | Prev | Next | Contents | Regular Expressions

Description


\d matches any digit and \D anything else. Compare Case 1 and Case 2. Use "[0-9]" if your programming language does not support this abbreviation (Case 3).

Source


Page 123; published: 1234 id=12#24@112

Case 1


Regular Expression: \d
First match:Page 123; published: 1234 id=12#24@112
All matches:Page 123; published: 1234 id=12#24@112

Case 2


Regular Expression: \D
First match:Page 123; published: 1234 id=12#24@112
All matches:Page 123; published: 1234 id=12#24@112

Case 3


Regular Expression: [0-9]
First match:Page 123; published: 1234 id=12#24@112
All matches:Page 123; published: 1234 id=12#24@112