I want to search with grep for a string that looks like this:
something ~* 'bla'
I tried this, but the shell removes the single quotes. Argh...
grep -i '"something ~* '[:alnum:]'"' /var/log/syslog
What would be the correct search?
grep -i "something ~\* '[[:alnum:]]*'" /var/log/syslog
works for me.
*
to match a literal *
instead of making it the zero-or-more-matches character:~*
would match zero or more occurrences of ~
while~\*
matches the expression ~*
after something
:alnum:
(see example here)*
after [[:alnum::]]
to match not only one character between your single quotes but several of them