Regular expression listing all possibilities

前端 未结 9 1458
感情败类
感情败类 2020-12-06 01:49

Given a regular expression, how can I list all possible matches? For example: AB[CD]1234, I want it to return a list like: ABC1234 ABD1234

I searched the web, but co

9条回答
  •  渐次进展
    2020-12-06 02:03

    It may be possible to find some code to list all possible matches for something as simple as you are doing. But most regular expressions you would not even want to attempt listing all possible matches.

    For example AB.*1234 would be AB followed by absolutely anything and then 1234.

提交回复
热议问题