Regular Expression to match specific string followed by number?

前端 未结 3 488
孤城傲影
孤城傲影 2020-12-31 01:15

What regular expression can I use to find this?

&v=15151651616

Where &v= is a static string and the number part may va

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-31 01:46

    "^&v=[0-9]+$" if you want at least 1 number or "^&v=[0-9]*$" if no number must match too.

    If you want it to match inside another sequence just remove the ^ and $, which means the sequence beginning by (^) and sequence ending with ($)

提交回复
热议问题