![]() |
|
Home Base A starting point, and place for threads don't seem to belong anywhere else |
|
Thread Tools | Display Modes |
![]() |
#11 |
I think this line's mostly filler.
Join Date: Jan 2003
Location: DC
Posts: 13,575
|
I was using unix's regex (I tested using sed).
The ^ is to denote the beginning of the line. the " *" is to include spaces. If you have tabs as well, you'd need [xy]*, where x is a space and y is a tab. The [01-9]* catches zero or more digits. I had the leading zero because I wasn't sure whether zero was actually first in ASCII, so I included it separately from the range. It is first, so [0-9]* would work. To make sure you don't get blank lines, it probably should be [1-9][0-9]*. The first brackets are one digit, and the second are zero or more additional digits. Then another " *" for trailing spaces. And a \$ for the end of the line. The $ is the symbol, but I need to escape it with the backslash so it doesn't get parsed by my command line. An updated version could be: Code:
^[ ]*[1-9][0-9]*[ ]*\$ Code:
(beginning of line marker)[whitespace characters]*[1-9][0-9]*[whitespace characters]*(end of line marker)
__________________
_________________ |...............| We live in the nick of times. | Len 17, Wid 3 | |_______________| [pics] |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|