Help with regex include and exclude

前端 未结 3 1328
生来不讨喜
生来不讨喜 2020-12-31 09:04

I would like some help with regex.

I\'m trying to create an expression that will include certain strings and exclude certain strings.

For example:

I

3条回答
  •  礼貌的吻别
    2020-12-31 09:40

    Make two regexes one for good and one for bad, and check both? (first the bad, then the good). You can do it with a single regex, but KISS is always a good rule ( http://en.wikipedia.org/wiki/KISS_principle )

    I'll add that you need to consider the "ass" principle... .*ass matches ambassador and cassette, so you'll probably want to have a separator ([./\\]) before and after each word. Obscenity Filters: Bad Idea, or Incredibly Intercoursing Bad Idea?

提交回复
热议问题