vendredi 6 juin 2014

specify regex for alternating between strings?


Vote count:

0




Given n arbitrary strings, s1, ..., sn, how can I specify a RegEx that can match all the strings?


For example,



I am not smart.



If I want to match am and ar, I can use a[mr]. But I don't know how to match am and not, because brackets can only specify a set of characters, not a set of strings.


Another example, How can I match both a* and b*? Are there any particular way for this particular example?


Thanks.



asked 27 secs ago

Tim

9,400





Aucun commentaire:

Enregistrer un commentaire