MemoryRefresh!

Egrep / Any character     Any character



Questions Answers 0%

Pages   0 from 15
Questions   0 from 20

Reset


Any character
The metacharacter /./ is a shorthand for a character class that matches any charater.
Example
For example if you want to match 19.03.76, or 19-03-76 you can use /19[-.]03[-.]76/ However you might also try simply using /19.03.76/ In the regex /[-./]/ the dots are not metacharacters because they are within a character class.
Knowing the target
It's important to know that each dot can match any character at all, even a lottery number: 19 203319 7639 /19.03.76/ is easy to understand, but vague. Knowing the target text well is an important part.
1) Which one matches any character?




2) Which one matches one dot?







Any character
The metacharacter /./ is a shorthand for a character class that matches any charater.
Example
For example if you want to match 19.03.76, or 19-03-76 you can use /19[-.]03[-.]76/ However you might also try simply using /19.03.76/ In the regex /[-./]/ the dots are not metacharacters because they are within a character class.
Knowing the target
It's important to know that each dot can match any character at all, even a lottery number: 19 203319 7639 /19.03.76/ is easy to understand, but vague. Knowing the target text well is an important part.

References









Programming

Php
   
Regex
   
MySQL
   
Css
   
jQuery
   
Git
   


References