The Now Platform® Washington DC release is live. Watch now!
Yesterday I showed you a regular expression (regex) that would find an SSN in text:
/(^|[^0-9])([0-9]{3}-[0-9]{2}-[0-9]{4})($|[^0-9])/m
var parser = /(^|[^0-9])([0-9]{3}-[0-9]{2}-[0-9]{4})($|[^0-9])/m;
var ans = parser.exec(text);
return (ans == null) ? null : ans[2];
'I have written my social security number (123-45-6789) in here, like this.'
0: '(123-45-6789)'
0: '(123-45-6789)'
1: '('
2: '123-45-6789'
3: ')'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.