The Code-Bin
abyss_pattern_match()
Posted by: TRUSTAbyss | August 4, 2008 @ 8:31am
Revision 2 - Original post on November 2, 2007 @ 10:56pm

PHP Code



Syntax Highlighting





Author Comments
This function will return TRUE if it matches a pattern specific to Abyss Web Server's.

The code above has been updated to add a few improvements. The ^ and ! characters outside of a set needed to be escaped but they weren't properly escaped. This new updated function will automatically escape these two characters outside of a set or when they're in the wrong place in a set. Even though these characters are automatically escaped, you should always escape them anyway (read the manual for Abyss's Pattern Matching system). The function above has been tested as much as possible to prevent any accidental errors from bad syntax. This new improvement is important because Regular Expressions need to have certain characters escaped, so adding the auto-escape feature is a crucial step to having a more safer function.
Rating


4.55 / 8
421 Votes