How to extract selected text in text wave

Hello everyone,

I wondering how I can extract selecting text in my text wave.
For example, I have this text in my text wave: 20141114_153532RGB.tif . How can I select only '153532' in my text wave and convert the selected text into numeric value?

Thank you in advance for your help.
Here is a special-purpose solution:
// Example:
//  Print ExtractNumberFromFileName("20141114_153532RGB.tif")
// Returns 153532.
Function ExtractNumberFromFileName(fileName)
    String fileName         // e.g., 20141114_153532RGB.tif

    Variable val1, val2
    sscanf fileName, "%g_%g", val1, val2
    return val2
End