Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2812

Re: Data Quality Regex

$
0
0

Erlan,

 

The thing with regex is that rules are likely to be unique (ie name starts with XXX or YYY or contains or ends in) which make it hard to know what you're after.  However, as it's a standard you can search online for techniques on how best to apply to your needs.

 

Some examples that may suit you are:

 

Emails (RFC5322): match_regex(rtrim(lower($email_address), ' '), '[a-z0-9!#$%&*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?', NULL)

 

Landline Phone:  match_regex(rtrim($landline_number, ' '), '[0-9]{2}\s[0-9]{4}\s[0-9]{4}', NULL) OR match_regex(rtrim($landline_number, ' '), '[0-9]{2}\s[0-9]{8}', NULL)

 

Mobile/ Cell Phone:  match_regex(rtrim($mobile_number, ' '), '04[0-9]{2}\s[0-9]{3}\s[0-9]{3}', NULL) OR match_regex(rtrim($mobile_number, ' '), '04[0-9]{2}\s[0-9]{6}', NULL)

 

regards

Adrian


Viewing all articles
Browse latest Browse all 2812

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>