Given strings
s1 = "abcfoodefbarghi"
and
s2 = "abcbardefooghi"
How can I split s1 into "abc" and "defbarghi" and s2 into "abc" and "defooghi" That is: split a string into two on the first occurrence of either one of strings "foo" or "bar"
I suppose this could be done with s.split(/regexp/)
, but what should this regexp be?