unix - Extract strings with exactly only two dots -
i looking extract strings have 2 dots below.
a.b.c $$abc.$$def.123
the relevance dots.
so far have tried
grep "\\.{2}" file_name.txt.
but not giving me result. please me
i think regular expression issue. \.{2} match 2 consecutive dots. you'll want like:
^[^\.]*\.[^\.]*\.[^\.]*$
which "start of string, 0 or more not-dots, dot, 0 or more not-dots, dot, 0 or more not-dots, end of string".
Comments
Post a Comment