I could have few valid strings in my application. Such valid strings may include:
"attached:yes blocked:yes" #No ()
"attached:yes blocked:(yes)" #Blocked has ()
"attached:(yes) blocked:yes" #Attached has ()
"attached:(yes) blocked:(yes)" #Both have ()
If I find blocked:(yes)
or blocked:yes
in any of the above strings, I would like to have the indices of the start and end of the matched part. So basically ignore (
or )
EXAMPLES
attached:yes blocked:yes
should give two indices start and end of substring of blocked:yes
, which is (13, 24)
attached:yes blocked:(yes)
should give two indices start and end of substring of blocked:(yes)
, which is (13, 26)