[Linux OT] Regular expresion question
Jean Sagi
jeansagi
Tue Oct 5 05:07:55 PDT 2004
You example works for the case I give. Thanks.
I didn't understand ".9" in the patterns you gave; what they are used for?
The pattern works with them and without them, I mean the next statement
works the way I want:
[chucho at oolnta hist]$ ls | grep -e "^h1[0-9].9" -e "^h2[0-5].9"
h100904
h120904
h130904
h180904
h200904
h240904
h250904
[chucho at oolnta hist]$ ls | grep -e "^h1[0-9]" -e "^h2[0-5]"
h100904
h120904
h130904
h180904
h200904
h240904
h250904
Finally I wonder if there is a more generic way of handling ranges with
regular expresions, or maybe I'm trying to use the way they are not
meant to.
Chucho!
Brad De Vries wrote:
> Jean, you could try sed using the following syntax:
> $ sed -n -e "/^h1[0-9].9/p" -e "/^h2[0-5].9/p"
>
>
More information about the Linux-users
mailing list