Help! What do these regular expression mean?
Posted: Sun Jul 18, 2010 11:05 pm
Hello. Can anyone explain to me the regular expressions in this code? It was part of a search engine code.
Thanks.
Code: Select all
/* Remove whitespace from beginning and end of string: */
$buf = trim($buf);
/* Try to remove all HTML-tags: */
$buf = strip_tags($buf);
$buf = ereg_replace('/&\w;/', '', $buf);
/* Extract all words matching the regexp from the current line: */
preg_match_all("/(\b[\w+]+\b)/",$buf,$words);