Re: help with grep



jammer <bjlockie@xxxxxxxxx> writes:

I'm trying to match 'ABCD 252'.

There is a variable number of spaces before the 2.
The 252 could be any number.

I tried:
grep 'ABCD[:blank:]+[:digit:]+' file

For simple "existence" matching I'd use

grep 'ABCD *[0-9]'

(note the two spaces). There's not need to match any more than one
digit. If you really do need to match the whole sequence of digits:

grep 'ABCD *[0-9][0-9]*'

--
Ben.
.



Relevant Pages

  • Re: Relative Cardinality
    ... > nth digit is for any n that WM is prepared to give it suddenly ... Now why does he acknowledge the existence of this irrational number? ... It would be somewhat daring to talk about a "line of reasoning" here. ... David Kastrup, Kriemhildstr. ...
    (sci.math)
  • Re: Relative Cardinality
    ... >> David Kastrup wrote: ... >> nth digit is for any n that WM is prepared to give it suddenly ... > existence of that particular irrational number. ... > Because you were able to specify a _single_ digit of this number which ...
    (sci.math)
  • Re: Regular Expression for Zipcode parsing
    ... > It is still matching the first 5 digit number. ... That matches the last sequence of 5 digits. ... The /.*/ is a very tempting solution, and in many cases is the ...
    (comp.lang.perl.misc)
  • file stream 1s 0s ?
    ... I open a binary file stream, ... which has millions or trillions of 1's & 0's ... If one digit is not matching, ...
    (comp.lang.c)
  • Re: Relative Cardinality
    ... If so replace the last digit but ... > "numbers" which are definitely excluded from existence, ... So there is not yet a showing that sqrtdoes ... Prev by Date: ...
    (sci.math)