Here's a generic parser. I should probably check to see how slowly this runs, and it may be overkill, but for now...

Global_Variable Integer ghFilter

Function FilterArray Global Variant[] aVariant Integer hObj Integer iMsg Returns Variant[] 
    Variant[] aReturn 
    Integer iPos 
    Integer iCopied 
    Integer iMax 
    Boolean isOK 
    Move (SizeOfArray(aVariant)) to iMax 
    For iPos from 0 to (iMax-1) 
        Get iMsg of hObj aVariant[iPos] to isOK 
        If (isOK) Begin 
            Move aVariant[iPos] to aVariant[iCopied]
            Move (iCopied+1) to iCopied 
    Move (ResizeArray(aVariant,iCopied)) to aVariant
    Function_Return aVariant

Function FilterString Global String sInp Integer hMsg Returns String 
    UChar[] aFixed
    Move (StringToUCharArray(sInp)) to aFixed 
    Get FilterArray aFixed ghFilter hMsg to aFixed 
    Move (UCharArrayToString(aFixed)) to sInp 

    Function_Return sInp 

Object oStringFilter is a cObject 
    Function IntegerFilter UChar iChar Returns Boolean
        If (iChar>57) Function_Return False  
        If (iChar<48) Function_Return False  
        Function_Return True 
    Move (Self) to ghFilter
It can go in its own package, and you can add new filter functions to the oStringFilter object (Only Ascii, Only AlphaNumeric, valid filenames, etc) as you need them.
To strip out all characters from a string, except [0..9], use

Get FilterString "ewnfhweh1234erfkeropg" (RefFunc(IntegerFilter)) to sInp