in reply to Re^3: regex finding longest string containing n of $c
in thread regex finding shortest string containing n of $c

Since I want to start at the begining of $foo, and can use *? between $c, Mark's updated solution works as desired.
  • Comment on Re^4: regex finding longest string containing n of $c