PHP (Regex) - Match url part with parenthesis

前端 未结 2 957
面向向阳花
面向向阳花 2021-01-24 03:05

I am pretty new to regex (only really started looking seriously to it a few hours ago) and even if it is not going that bad... I am having a bad time matching parenthesis.

相关标签:
2条回答
  • 2021-01-24 03:40

    \/\(*[A-z]+\)*\/[0-9]+$

    matches: /(offset)/29

    \/[A-z]+\/[0-9]+$

    matches: /offset/29

    Hope it helps

    0 讨论(0)
  • 2021-01-24 03:43

    Use this regex:

    \/\(offset\)\/\d{2,3}
    

    Demo:http://regex101.com/r/tZ7zS4

    0 讨论(0)
提交回复
热议问题