Regular expression problem

This may be a newbie question, but I have to ask about it!
In general, I understand regular expressions, but I don't understand why this one:

^.{8}[[:blank:]]{2}

works on this line:

prelink: /lib/libkeyutils-1.2.so: at least one of file dependencies has changed since prelinking

in this grep command:

echo "prelink: /lib/libkeyutils-1.2.so: at least one of file dependencies has changed since prelinking" | grep -v '^.\{8\}[[:blank:]]\{2\}'

Where:

The says "beggining of line"  
The. {8} says "any eight characters"  
The [[: blank:]] {2} says "any two space characters"  

So, {.8} matches "prelink:" when [[: blank:]] {2} requires matching "" (two spaces), but we only have "" (one space) ... So why does this work at all , and if this work is somehow this:

^.{8}[[:blank:]]{1} 

does not work?

Thank you in advance.

+3
source share
1

grep -v, , . -v, , .

grep --help
...
   -v, --invert-match        select non-matching lines
...
+8

Source: https://habr.com/ru/post/1759195/


All Articles