I have a txt file from which I want to get only the expressions of the type 'USA_word*' where * is whatever ( I don't want the whole line, only the expressions )
I try the command
grep -oP ''USA_word*'' But I get a list :
USA_word USA_word USA_word ..... without the part signified by the *.
grep -o 'USA_word[^[:blank:]]*'? That should work if by "expressions" you mean any 0+ non-whitespace chars.