The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Another sed question
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Another sed question
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
10-21-2008
wempy
Registered User
Join Date: Jun 2006
Location: Harpenden, UK
Posts: 208
you need to add some quantifiers and limiters in there
Code:
sed
's/.*\([0-9]\{3\}-[0-9]\{4\}-[0-9A-Z]\{3\}\).*/\1/'
which will look for anything followed by \( exactly 3 digits followed by a - followed by exactly 4 digits, followed by a - followed by a combination of 3 letters and/or digits \) followed by anything and replace it all with the part above in \( .. \)
Last edited by wempy; 10-21-2008 at
11:38 AM
.. Reason: for clarity
wempy
View Public Profile
Visit wempy's homepage!
Find all posts by wempy
Find wempy's past nominations received
Find wempy's present nominations given