The sed command can use a full stop to find a wild card symbol, and so .* retrieves everything on the line.Is it possible to say that I wish any symbol at all except (in this case) spaces? So:FredSmith - would be validFred&Ginger - would be valid6times7 - would be validOne too many - would not be valid
Linux sed - finding a wildcard string with no spaces in it
sed;regular expression
Yes, it's possible.echo One too many | sed -n '/^[^[:space:]]*$/p'The above command returns nothingecho FredSmith | sed -n '/^[^[:space:]]*$/p'FredSmithWhile the latter prints FredSmith[:space:] - POSIX character class for space characters/^[^[:space:]]*$/p - means print match if it contains only non-space characters [^[:space:]] (used negated character class)