0

My test string are following

2s, 5s
2s, 5.5s

I am trying to write a regex that matches any integer or decimal after ,

I can separately write

(?<=\, )\d\.\d

which would return 5.5

or write

(?<=\, )\d

which would return 5

How can I combine both of them?

I tried this which does not work

(?<=\, )\d||\d\.\d
smpa01
  • 4,149
  • 2
  • 12
  • 23

0 Answers0