I've no idea how to incorporate the /c modifier. It'll be pointless for two reasons. First, one sets pos() before matching, so who cares about the effect of /c. Second, /c would only kick in if you add a substring foo to $x, and the next time around, foo isn't there.