Regular Expression for Percentage of marks

前端 未结 4 1844
一向
一向 2021-01-17 17:04

I am trying to create a regex that matches percentage for marks

For example if we consider few percentages

1)100%
2)56.78%
3)56 78.90%
4)34.6789%
         


        
4条回答
  •  渐次进展
    2021-01-17 17:59

    \\d+(?:\\.\\d+)?%
    

    This should do it for you.

    For more stringent test use,

    \b(?

    See demo.

    https://regex101.com/r/zsNIrG/2

提交回复
热议问题