-1

I have this string Red:255,Green:255,Blue:255
I am trying to get for example: the 255 value of red.

I am very new to regex and I have tried (?<=Red:\s).*(?=\s,) but it does not work.
How do I achieve this?

eric
  • 175
  • 2
  • 17

2 Answers2

0

For java you can use this regex:

Red:(\d+),Green:(\d+),Blue:(\d+)

You can try here: https://www.freeformatter.com/java-regex-tester.html#ad-output

StephaneM
  • 4,364
  • 1
  • 14
  • 32
0

You can use following regex:

Red:(\d+),.*
S.K.
  • 3,337
  • 2
  • 13
  • 27