Answer the question
In order to leave comments, you need to log in
Regular expressions in grep with single quotes and double quotes, what's the difference?
for example, I use a file with the following content:
\x47L
\x47L\x47L
\x47L\x47L\x47L
\x47L\x47L\x47L\x47L
\x47L\x47L\x47L\x47L\x47L
\x47L\x47L\x47L\x47L\x47L\x47L
you need to find lines where '\x47L' is repeated 3 or more times.
grep -E '(\\x[a-zA-Z0-9]{3}){3,}' filename //
grep -E "(\\x[a-zA-Z0-9]{3} works ){3,}" filename //DOES NOT work
grep -E '(\\x47L){3,}' filename //
DOES grep -E "(\\x47L){3,}" filename //DOES NOT work
If in write file :
a
aa
aaa
aaaa
aaaaa
then it works like this:
"(a){3,}"
and like this:
'(a){3,}'
wtf?
Answer the question
In order to leave comments, you need to log in
will work like this
. But if you use " inside the argument, you may not like it.
So in fact the difference is that they are different characters and if I use the
"date='%Y'" construct, then everything works correctly,
but if
'date='%Y' ' as you understand there will be no kin
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question