Character classes specify an entire range of characters??”
for example, the alphabet or an integer set. Standard classes include the following:
CHAPTER 9 ?– S TRINGS AND REGULAR EXPRESS IONS 235
[:alpha:]: Lowercase and uppercase alphabetical characters. This can also be
specified as [A-Za-z].
[:alnum:]: Lowercase and uppercase alphabetical characters and numerical
digits. This can also be specified as [A-Za-z0-9].
[:cntrl:]: Control characters such as tab, escape, or backspace.
[:digit:]: Numerical digits 0 through 9. This can also be specified as [0-9].
[:graph:]: Printable characters found in the range of ASCII 33 to 126.
[:lower:]: Lowercase alphabetical characters. This can also be specified as [a-z].
[:punct:]: Punctuation characters, including ~ ` ! @ # $ % ^ & * ( ) - _ + = { } [ ] : ;
' < > , . ? and /.
[:upper:]: Uppercase alphabetical characters. This can also be specified as [A-Z].
[:space:]: Whitespace characters, including the space, horizontal tab, vertical
tab, new line, form feed, or carriage return.
[:xdigit:]: Hexadecimal characters. This can also be specified as [a-fA-F0-9].
PHP??™s Regular Expression Functions (POSIX Extended)
PHP offers seven functions for searching strings using POSIX-style regular expressions:
ereg(), ereg_replace(), eregi(), eregi_replace(), split(), spliti(), and
sql_regcase(). These functions are discussed in this section.
Pages:
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313