All pastes #1486558 Raw Edit

Stuff

public java v1 · immutable
#1486558 ·published 2009-07-07 06:25 UTC
rendered paste body
                StringBuilder terms = new StringBuilder();                for (int i = 0; i < searchWords.length; i++) {                    terms.append(Pattern.quote(searchWords[i]));                    if (i + 1 < searchWords.length) {                        terms.append('|');                    }                }//here i would remove the last | from the end                pSearch = Pattern.compile("(^|[\s,.!]+)" + terms.toString() + "([\s,.!]+|$)", Pattern.CASE_INSENSITIVE /*| Pattern.UNICODE_CASE*/);