Say I have a string conatining a few words:
STRING="one two three four five six seven";
how do I go about removing the first three words? I've search google but not yet found anything that seems to do what I want.
I would like to use the following regex:
"[^ ]* [^ ]* [^ ]* "
As demonstrated i Java:
Code:
String string = "one two three four five six seven";
string = string.replaceFirst("[^ ]* [^ ]* [^ ]* ","");
System.out.println(string)
I've tried
echo ${STRING/[^ ]* [^ ]* [^ ]* /}
but that just gives me the very last word.