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

Description


If literal value of a special character is required, it must be escaped with a backslash \. Case 1 does not match anything as both characters a special, Case 2 matches all $, Case 3 matches $ only if it is the first and Case 4 the last character. Backslash has special meaning and must be also escaped for literal use (Case 5).

Source


$12$ \-\ $25$

Case 1


Regular Expression: ^$
First match:$12$ \-\ $25$
All matches:$12$ \-\ $25$

Case 2


Regular Expression: \$
First match:$12$ \-\ $25$
All matches:$12$ \-\ $25$

Case 3


Regular Expression: ^\$
First match:$12$ \-\ $25$
All matches:$12$ \-\ $25$

Case 4


Regular Expression: \$$
First match:$12$ \-\ $25$
All matches:$12$ \-\ $25$

Case 5


Regular Expression: \\
First match:$12$ \-\ $25$
All matches:$12$ \-\ $25$