Quantcast
Channel: What grep pattern allows to print only one-word lines? - Ask Ubuntu
Browsing all 3 articles
Browse latest View live

Answer by muru for What grep pattern allows to print only one-word lines?

To print lines containing only (and at least one) non-whitespace characters, use one of:grep -x '[^[:space:]]\+'grep -Ex '[^[:space:]]+'Or with PCRE patterns:grep -Px '\S+'The POSIX character class...

View Article



Answer by Raffa for What grep pattern allows to print only one-word lines?

Without punctuationgrep -E '^\w*[[:alpha:]]\w*$' file... that will only match possible (zero or more *) word characters \w (alphabetical, numerical and underscore) that span the whole line ^...$...

View Article

What grep pattern allows to print only one-word lines?

I want to print the lines with only one no-spaces subsequences of characters while use grep on the text.title after grepping should to print titlethe sentence after grepping should not print anything

View Article
Browsing all 3 articles
Browse latest View live




Latest Images