Maybe there is a neater code
- Code: Select all Expand view RUN
function cExtractAlphabets(cStr)
local a_ := hb_regexAll("[A-Za-z ]", cStr), cRet := "", aChar
if a_ != nil
for each aChar in a_
cRet += aChar[1]
next
endif
return cRet // returns alphabet and space only
- Code: Select all Expand view RUN
function cExtractNum(cStr)
local a_ := hb_regexAll("\d{1,}", cStr), cNum := "", aDigit
if a_ != nil
for each aDigit in a_
cNum += aDigit[1]
next
endif
return cNum