Regex - Repeating Capturing Group

后端 未结 2 537
春和景丽
春和景丽 2020-12-01 19:08

I\'m trying to figure out how I can repeat a capture group on the comma-separated values in this the following url string:

id=1,2;name=user1,user2

2条回答
  •  时光说笑
    2020-12-01 19:54

    Capturing Group Repeated

    String: !abc123def! regex: /!((abc|123|def)+)!/

    Matchs:

    Group 1: abc123def

    Group 2: def

    source: https://www.regular-expressions.info/captureall.html

提交回复
热议问题