Artificial intelligent assistant

Print all lines which not containing punctuation I want a regex pattern which can print all lines which not containing punctuation : **Input :** .This is line 1 This is ! line 2 This is line (3) This is line 4 **Output:** ( should be) This is line 4 **What I've tried so far :** grep '[^[:punct:]]' file.txt But it shows all characters which is not punctuation.

Your `grep` prints all lines containing non-punctuation characters. That's not the same as printing all lines that do not contain punctuation characters.

For the latter, you want the `-v` switch (print lines that don't match the pattern):


grep -v '[[:punct:]]' file.txt


If, for some reason you don't want to use the `-v` switch, you must make sure that the whole line consists of non-punctuation characters:


grep '^[^[:punct:]]\+$' file.txt

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 4ed84b91ae76793c808b93d1e5647440