projects
/
migration-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
5e26cba
)
Will leave 'unlisted' alone
author
Ben Ostrowsky
<ben@esilibrary.com>
Mon, 12 Apr 2010 22:08:34 +0000 (22:08 +0000)
committer
Ben Ostrowsky
<ben@esilibrary.com>
Mon, 12 Apr 2010 22:08:34 +0000 (22:08 +0000)
sql/base/base.sql
patch
|
blob
|
history
diff --git
a/sql/base/base.sql
b/sql/base/base.sql
index
ded01ba
..
6d9de88
100644
(file)
--- a/
sql/base/base.sql
+++ b/
sql/base/base.sql
@@
-702,7
+702,7
@@
CREATE OR REPLACE FUNCTION migration_tools.attempt_phone (TEXT,TEXT) RETURNS TEX
n_digits INTEGER := 0;
BEGIN
temp := phone;
- temp := REGEXP_REPLACE(temp, '^1*[^0-9]*', '');
+ temp := REGEXP_REPLACE(temp, '^1*[^0-9]*(?=[0-9])', '');
temp := REGEXP_REPLACE(temp, '[^0-9]*([0-9]{3})[^0-9]*([0-9]{3})[^0-9]*([0-9]{4})', E'\\1-\\2-\\3');
n_digits := LENGTH(REGEXP_REPLACE(REGEXP_REPLACE(temp, '(.*)?[a-zA-Z].*', E'\\1') , '[^0-9]', '', 'g'));
IF n_digits = 7 THEN