regexp help
I am no good with regular expressions. Could someone give me a regular expression that grabs (matches) sequences that include a hyphen and a number. I want to match like this:
text-23-more-text-456 hyphen and number and not just hyphens. I got the following: -[\d]* but that matches all hyphens and numbers. I just want hyphens followed by any number of numbers. Help! |
Untested: -\d+-?
|
Hi Dear
I don't know wat exactly u want. Try out If u want only " - " before a number : grep -E '[-]\d*' filename this may help you. Suresh |
Why on earth did you dig this three year old carcass of a thread up?
Closed. Cheers, Tink |
All times are GMT -5. The time now is 07:02 AM. |