/** * Build a set of regular expressions from the given multiline input text, * with empty lines and comments stripped. * * @param $source string * @param $fileName bool|string optional, for reporting of bad files * @return array of regular expressions, potentially empty */ static function regexesFromText( $source, $fileName=false ) { $lines = explode( "\n", $source ); return SpamRegexBatch::buildSafeRegexes( $lines, $fileName ); }