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

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -