Why doesn't [01-12] range work as expected?

后端 未结 6 1743
有刺的猬
有刺的猬 2020-11-22 03:34

I\'m trying to use the range pattern [01-12] in regex to match two digit mm, but this doesn\'t work as expected.

6条回答
  •  渐次进展
    2020-11-22 04:22

    As polygenelubricants says yours would look for 0|1-1|2 rather than what you wish for, due to the fact that character classes (things in []) match characters rather than strings.

提交回复
热议问题