当前位置: 动力学知识库 > 问答 > 编程问答 >

regex - URL Regular Expression to match exact 'n' characters before decimal

问题描述:

I require a URL expression to match exact 'n' number of characters before decimal point. Can anyone help me please.

网友答案:

The example below matches 2

\d{2}\.

To only match the digits put them in a a capturing group

(\d{2})\.

Or use lookaround

\d{2}(?=\.)
分享给朋友:
您可能感兴趣的文章:
随机阅读: