我正在尝试生成一个匹配单个日期的正则表达式脚本,如果没有后跟',','和'或者'&'。例如,我希望匹配
on mondays
或
on monday
但不是
on mondays,
或
on mondays and
或
on mondays &
到目前为止,我有:
\b(?:on|in)\s+(?:weeknights?|weekends?|weekdays?|mornings?|afternoons?|nights?|evenings?|mondays?|tuesdays|wednesdays?|thursdays?|fridays?|saturdays?|sundays?|(?:(?:mon|tues?|weds?|thu(?:rs|r)?|fri|sat|sun)s?\.?))(?!(?:\,|\s+and\s+|\s+&\s+))
但是在
的情况下on mondays,
它匹配
on monday
而不是根本没有匹配。关于如何解决这个问题的任何想法?