Prev | Current Page 297 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

This sequence may be a pattern with
which you are already familiar, such as the word dog, or it may be a pattern with
specific meaning in the context of the world of pattern matching, <(?)>.*<\ /.?>,
for example.
PHP is bundled with function libraries supporting both the POSIX and Perl regular
expression implementations. Each has its own unique style of syntax and is discussed
accordingly in later sections. Keep in mind that innumerable tutorials have been
written regarding this matter; you can find information on the Web and in various
books. Therefore, this chapter provides just a basic introduction to each, leaving it to
you to search out further information.
If you are not already familiar with the mechanics of general expressions, please
take some time to read through the short tutorial that makes up the remainder of this
section. If you are already a regular expression pro, feel free to skip past the tutorial to
the section ???PHP??™s Regular Expression Functions (POSIX Extended).???
Regular Expression Syntax (POSIX)
The structure of a POSIX regular expression is similar to that of a typical arithmetic
expression: various elements (operators) are combined to form a more complex expression.
The meaning of the combined regular expression elements is what makes them
so powerful. You can locate not only literal expressions, such as a specific word or
number, but also a multitude of semantically different but syntactically similar strings,
such as all HTML tags in a file.


Pages:
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309