&& (a) three digits, optionally in () && (b) space char && (c) three digits && (d) space or hyphen or nothing && (e) four digits && (f) trailing space && or && (c) three digits && (d) space or hyphen or nothing && (e) four digits && (f) trailing spaceYou can take out (f) trailing space, if needed - depends on how your data is structured
loRegExp = CREATEOBJECT("VBScript.Regexp") loRegExp .pattern = '^((\(\d{3}\)|\d{3})\s?)?\d{3}[-\s]?\d{4}\s*$' && last line is invalid text to s noshow pretext 7 (999) 123-1288 888 123-9999 900 1111 9001111 900-1111 900111 endtext naa = alines(aa, s, 5, chr(0x0d) + chr(0x0a)) for each x in aa ? x, ' ', loRegExp.Test(x) endfor