简体   繁体   中英

A regular expression which will match all Or, It and And words in the string without . or : before these words

I am looking for a regular expression which will match all Or, It and And words in the string without . or : before these words.

For example I want the following behavior:

  • ". And", ": Or", ". It" --> not match
  • "And", "Or", " It" --> match

It quite easy to get opposite result. This (:|\\.)+ *((\\bIt\\b)|(\\bOr\\b)|(\\bAnd\\b)) will match ". And" and will ignore "And", however this is not what I need.

Any help is appreciated!

您的朋友否定性的落后: (?<![.:] )(And|Or|It)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM