Thank you for your assistance !
More specific goal is find VALUE knowing a KEY from STRING.
sampleString = "source_string_to_KEY1:VALUE1_match_with_pattern_KEY2:VALUE2"
So for example I need to capture (only) VALUE1 when i know only KEY1 from that sampleString.
Key:Value pairs are with colon-separated form. All words are underline-separated in that string. String is used in DOM Element ID name.
Yes, I can solve this with unskilful string handling. Like splitting string by '_' to substrings, finding stings, that contains ':', then comparing first part of this substring with knowing key and finally return last part as a match.
Probably there is possibility find this match simply with regular expression. This regex should find this key:value pair but only capture required value part. Is there any possibility ?
This is my goal.