Fuad - 2008-01-24 00:28:07

I have the following example and need to parse only the numbers from the string:

From:

EG2594

To:

2594

or,

From: EG2594_1

To:

2594

Then I need to add a P to the extracted numbers, so it would end up as:

P2594

as my output.

What is the best, simplest way to do this in unix C?

compare each character's ASCII value? Or how...?