Thursday, 15 July 2010

regex - match non-numbers except forward slash using sed -



regex - match non-numbers except forward slash using sed -

i know can match non-numbers using:

sed 's/[^0-9]//g'

but how can match non-numbers except forwards slashes?

thank in advance.

~chris

how can match non-numbers except forwards slashes?

i find easier think when rephrase problem so:

how can match except numbers , forwards slashes?

to this, add together forwards slash character class:

sed 's/[^0-9/]//g'

this saying want match except digits , forwards slashes.

regex linux unix sed

No comments:

Post a Comment