也就是说,我希望定制我的正则表达式来识别以下内容apple and lemon
、apple lemon
、apple and
和apple
.我希望单词and
和lemon
是可选的,目前我只设法将and
设置为可选,而不是lemon
.
It would be great if it's achievable with the current format of the regex.个
Regex:
\b([a][\W_]*?)+([p][\W_]*?)+([p][\W_]*?)+([l][\W_]*?)+([e][\W_]*?)+(([a][\W_]*?)+([n][\W_]*?)+([d][\W_]*?))?([l][\W_]*?)+([e][\W_]*?)+([m][\W_]*?)+([o][\W_]*?)+([n][\W_]*?)+\b
Regex101: