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

Description


\w matches any word character ( alphanumeric plus "_" ). In some languages these letter abbreviations are not recognized. Use character classes ("[A-z0-9_]") instead (Case 5).

Source


A1 B2 c3 d_4 e:5 ffGG77--__--

Case 1


Regular Expression: \w
First match:A1 B2 c3 d_4 e:5 ffGG77--__--
All matches:A1 B2 c3 d_4 e:5 ffGG77--__--

Case 2


Regular Expression: \w*
First match:A1 B2 c3 d_4 e:5 ffGG77--__--
All matches:A1 B2 c3 d_4 e:5 ffGG77--__--

Case 3


Regular Expression: [a-z]\w*
First match:A1 B2 c3 d_4 e:5 ffGG77--__--
All matches:A1 B2 c3 d_4 e:5 ffGG77--__--

Case 4


Regular Expression: \w{5}
First match:A1 B2 c3 d_4 e:5 ffGG77--__--
All matches:A1 B2 c3 d_4 e:5 ffGG77--__--

Case 5


Regular Expression: [A-z0-9_]
First match:A1 B2 c3 d_4 e:5 ffGG77--__--
All matches:A1 B2 c3 d_4 e:5 ffGG77--__--