Numbers

Percentage

Matches percentage values with optional decimal and a trailing % sign.

Try it in RegexPro

Pattern

regexJavaScript
/^\d+(\.\d+)?%$/

Raw source: ^\d+(\.\d+)?%$

How it works

`^\d+` matches integer part. `(\.\d+)?` optional decimals. `%$` requires a trailing percent sign at end.

Examples

Input

95%

Matches

  • 95%

Input

99.9%

Matches

  • 99.9%

Input

100

No match

Common use cases

  • Statistics
  • Form inputs
  • Report parsing