Oracle Tips by Burleson
( string pattern, string subject [, array &matches [, int flags [, int
This searches subject for a match to the
regular expression given in pattern. If matches is
provided, it is filled with the results of search. $matches
contains the text that matched the full pattern, $matches
has the text that matched the first captured parenthesized
sub-pattern, and so on.
The function above uses practically the same
pattern matching syntax as Perl because it uses PCRE (Perl Compatible
Regular Expressions) library as the pattern matching engine. The
preg_matchfunction is not the
only PCRE function implemented in PHP, it is one of several functions.
The other PCRE functions are:
These functions are very well documented in the
online documentation on the PHP home page,
Regular expression syntax is quite an extensive
subject covered in several books and is beyond the scope of this book.
Detailed documentation for PCRE library can be found on
http://www.pcre.org. Probably, the
best introductory document for Perl’s regular expression syntax is the
legendary “llama book”, Learning Perl by Randal Schwartz and Tom
Mastering regular expressions is wholeheartedly
recommended not just because they are extremely useful in scripting
languages like PHP and Perl; they are also supported by the latest and
the greatest version of Oracle RDBMS,
This completes supplied functions in this chapter.
The additional functions are introduced later in this book and are
explained with detailed examples. PHP5 is a scripting language that
borrows its philosophy from C. The syntax is extremely simple, yet
very powerful, while the additional complexities a placed in the
functions instead in the syntax. One of the things that make Perl
rather complex and difficult to learn is its syntax with a multitude
of operators, expression syntaxes, built-in variables and language
idioms. PHP has none of that. Complexities of regular expressions are
placed in functions, as is the case with most of other things.
code depot for complete scripts
The above book excerpt is from:
Create Dynamic Web Pages with Oracle Data