Metacharacters in Regular Expresions
ereg_replace
To delete all signs / symbols from a string, you can use the function with special values:
ereg_replace(”[[:punct:]]”,”,$string);
The following is a set of special values that denote certain common ranges. They have the advantage that also take in account the ‘locale’ i.e. any variant of the local language/coding system.
[:digit:] Only the digits 0 to 9
[:alnum:] Any alphanumeric character 0 to 9 OR A to Z or a to z.
[:alpha:] Any alpha character A to Z or a to z.
[:blank:] Space and TAB characters only.
[:xdigit:] .
[:punct:] Punctuation symbols . , ” ‘ ? ! ; :
[:print:] Any printable character.
[:space:] Any space characters.
[:graph:] .
[:upper:] Any alpha character A to Z.
[:lower:] Any alpha character a to z.
[:cntrl:]
Related Posts:
- Signs for Regular Expresions
^ Start of line$ End of linen? Zero or only one single occurrence of character ‘n’n* Zero or more occurrences of character ‘n’n+ At least one or more oc...
Tags: Metacharacters, Regular Expresions
29.Sep.08
PHP
You can leave a response, or trackback from your own site.
Leave a Comment
- EarlyEdition.Info
-
Recent Posts
Categories
-
© EarlyEdition.Info | RSS Feed
26 q. 0.242 s.