«« Next » « Previous
«« Next » « Previous

Link Details

The more, the merrier! Login and vote now.
Link 80707 thumbnail

By bloid
via eggheadcafe.com
Submitted: May 13 2008 / 05:46

This is a question that apparently comes up frequently: What is the fastest way to search a string of text for a bunch of keywords (e.g., a "badwords" list for cleaning or disallowing forum spam, etc.). To the average developer, two approaches come to mind: First, the "brute force" String.IndexOf method. Second, using REGEX to find matches based on an OR (x|y|z..) expression.
  • 1
  • 0
  • 115
  • 23

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (1)



Voters Against This Link (0)