On Tue, 4 Oct 2016 15:38:00 +0800 Lam Bruce <brucelam198...@gmail.com> wrote:
> Dear Sir/Madam: > > I put all files in the atttachment. > > cat datafile > > northwest NW Charles Main 3.0 .98 3 34 > western WE Sharon Gray 5.3 .97 5 23 > southwest SW Lewis Dalsass 2.7 .8 2 18 > southern SO Suan Chin 5.1 .95 4 15 > southeast SE Patricia Hemenway 4.0 .7 4 17 > eastern EA TB Savage 4.4 .84 5 20 > northeast NE AM Main Jr. 5.1 .94 3 13 > north NO Margot Weber 4.5 .89 5 9 > central CT Ann Stephens 5.7 .94 5 13 > 989 > > egrep '2\.?[0?9]' datafile > eastern EA TB Savage 4.4 .84 5 20 > > egrep '2\.{0,1}[0?9]' datafile > eastern EA TB Savage 4.4 .84 5 20 > > egrep '2\.\{0,1\}[0?9]' datafile > > egrep '2\.{0,1}[0-9]' datafile > western WE Sharon Gray 5.3 .97 5 23 > southwest SW Lewis Dalsass 2.7 .8 2 18 > eastern EA TB Savage 4.4 .84 5 20 > > egrep -n '2\.{0,1}[0-9]' datafile > 2:western WE Sharon Gray 5.3 .97 5 23 > 3:southwest SW Lewis Dalsass 2.7 .8 2 18 > 6:eastern EA TB Savage 4.4 .84 5 20 > > Best Regards, > > Bruce EN DASH (U2013) instead of HYPHEN-MINUS (U002D) are used in from first to third question. [0 U2013 9] does not express a range to a list of 0, U2013 or 9, so I seem that all results are right.