Regex: Matching against groups in different order without repeating the group

后端 未结 4 1285
遇见更好的自我
遇见更好的自我 2021-01-31 11:21

Let\'s say I have two strings like this:

XABY
XBAY

A simple regex that matches both would go like this:

X(AB|BA)Y
4条回答
提交回复
热议问题