Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If that is the case, wouldn't we just use more specialized functions, I forget the boost_regex function for C++, but for PHP we can do strpos() instead strstr() to see simply if a string exists? In that case, I'm guessing the benchmarks would be closer.


Substring location won't tell you if your string is an email, for example.




From the page you linked:

> This regular expression will only validate addresses that have had any comments stripped and replaced with whitespace (this is done by the module).

There is filtering done before the regex is applied.


Yes, good point.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: