src/StringLib.php
/**
     * Check whether the provided string is a regexp.
     * Reference: 
     * http://stackoverflow.com/questions/8825025/test-if-a-regular-expression-is-a-valid-one-in-php
     */
Check whether the provided string is a regexp.
Check whether the provided string is a regexp .
public static function isRegExp($regexp)
    {
        $isRegExp = true;
        if (@preg_match($regexp, "Put any string in here.") === false) 
        {
            $isRegExp = false;
        }
        return $isRegExp;
    }
public static function isRegExp ( $ regexp ) { $ isRegExp = true ; if ( @ preg_match ( $ regexp , " Put any string in here. " ) === false ) { $ isRegExp = false ; } return $ isRegExp ; }
Check whether the provided string is a regexp.
Check whether the provided string is a regexp .