Why does the regex work not as expected?

前端 未结 4 515
余生分开走
余生分开走 2021-01-25 14:17

There is a string which can have one or several string ranges. These are correct strings:

\"\"
\"asd-asd\"
\"asd-asd;asd-asd\"
\"asd-asd;asd-asd;\"
\"asd-asd;asd         


        
4条回答
  •  一向
    一向 (楼主)
    2021-01-25 15:07

    It matches because of ;? which makes the ; optional. You are trying to test something with context, regex is not the easiest tool to do this.

提交回复
热议问题