I want to regex match any alphabet/number/underscore character as well as double colons in a string if the first word contains "Blue".
For example,
Blue Red Yellow //return Red
Blue Red::Orange Yellow //return Red::Orange
Purple Red Yellow //return nothing
Blue R_E_D //return R_E_D
Red Blue //return nothing
Blue.ish Yellow //return Yellow
I tried /Blu\S+\s+(\w+)/ and it's working for all cases except the :: case. How can I add a match after checking for w+ to match double colons as well IF present without having to mandate my regex to only match if there is a :: present as well.