On 05/20/2018 04:16 PM, yary wrote:
PRM's suggestion was "/inverting the entire regex -- i.e., instead of
matching finding things that do match, exclude the things that don't ...
use !~~ or some similar logic to get the strings wanted/" which IMO is
an excellent idea. Your implementation didn't take the inversion into
account- try this
p6 'if "hgm" *!~~* / gm | <-[d..z]> / {say "y"} else {say "n"}'
p6 'if "hgm" !~~ / gm | <-[d..z]> / {say "y"} else {say "n"}'
n
$ p6 'if "cgm" !~~ / gm | <-[d..z]> / {say "y"} else {say "n"}'
n
$ p6 'if "zgm" !~~ / gm | <-[d..z]> / {say "y"} else {say "n"}'
n
$ p6 'if "z" !~~ / gm | <-[d..z]> / {say "y"} else {say "n"}'
y
Thank you!