println "blahblahblah ---foobar-- blahblahblah".split("-+")[1]println "some-text ---fo-ob-ar-- another-text".split("---")[1].split("--")[0]
Standard input is empty
foobar fo-ob-ar
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!