[Previous] [Contents] [Next]


Metacharacters

Metacharacters can also be used in regular expressions. For example, the tab character is represented as \t and the carriage-return character as \n. There are also shortcuts: \d means any digit, and \s means any whitespace. The following example returns true as the tab character, \t, is contained in the $source string:

$source = "fast\tfood";

$result = ereg('\s', $source); // true

[Previous] [Contents] [Next]