<html><body>
<p>Hi All;<br>
I've been trying to write a sed function to return only a numeric portion of a string, but can't seem to get it working.<br>
The input is a single string of letters and numbers, with the numbers always consecutive.<br>
For example:  BUILD-AM005-a<br>
<br>
I want to get the 005 out of this string.<br>
<br>
echo  BUILD-AM005-a | sed 's/.*\([[:digit:]]\).*/\1/g'<br>
<br>
will return the digit 5.  This is good!<br>
<br>
So I add an asterisk to try to match multiple digits like:<br>
echo  BUILD-AM005-a | sed 's/.*\([[:digit:]]*\).*/\1/g'<br>
<br>
and instead of returning 005, it doesn't match anything, so returns nothing.<br>
<br>
Can any of you RE maters help me out?<br>
<br>
Steve Moffat<br>
IBM Global Services<br>
sjm@ca.ibm.com<br>
(204)792-3245<br>
</body></html>