我想编写一个识别以下模式的 java 正则表达式。abc def the ghi and abc def ghi
abc def the ghi
abc def ghi
我试过这个:
abc def (the)? ghi
但是,它没有识别第二种模式。我哪里出错了?
abc def (the )?ghi ^^
删除多余的space
space