-6

I'm using SoapUI and I have responses of JSON which contains strings.

For example about string "84,96". I need to create a regular expression which verifies that all value decimals of this JSON are containing a comma (,) but not a point (.)

Examples:
"84,96" is Good
"84.96" is wrong

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Khalid Ksouri
  • 181
  • 14

2 Answers2

0
^(\d+?,?\d+)$

this solves your question test here Test

Edu G
  • 1,030
  • 9
  • 23
0

Numbers

84,96 <-- good
84.96 <-- bad

REGEXEP:

\d+,\d+

Explanation:

\d+ <= All Numbers (84)
,   <= Only Comma  (,)
\d+ <= All Numbers (96)

Result:

84,96

Test Here: https://regex101.com/r/7NNRZy/1