Use Unicode-friendly regular expressions for registering and retrieving patrons by...
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 29 May 2009 19:53:10 +0000 (19:53 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 29 May 2009 19:53:10 +0000 (19:53 +0000)
This enables patrons with names like Étienne or ԱԲԳԱՐ to be registered and retrieved

git-svn-id: svn://svn.open-ils.org/ILS/trunk@13263 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/search_form.js
Open-ILS/xul/staff_client/server/patron/ue_config.js

index 7221129..7675904 100644 (file)
@@ -317,7 +317,7 @@ patron.search_form.prototype = {
                                                case 'family_name' :
                                                case 'first_given_name' :
                                                case 'second_given_name' :
-                                                       value = value.replace(/^\W+/g,'').replace(/\W+$/g,'');
+                                                       value = value.replace(/^[\d\s]+/g,'').replace(/[\d\s]+$/g,'')
                                                break;
                                        }
                                        if (value != '') {
index 5761b79..e4c3fd4 100644 (file)
@@ -32,7 +32,7 @@ const unameRegex      = /^\w[\.\w\@-]*$/;
 const ssnRegex         = /^\d{3}-\d{2}-\d{4}$/;
 const dlRegex          = /^[a-zA-Z]{2}-\w+/; /* driver's license */
 const phoneRegex       = /^\d{3}-\d{3}-\d{4}(| \S+.*)$/i;
-const nonumRegex       = /^[a-zA-Z]\D*$/; /* no numbers, no beginning whitespace */
+const nonumRegex       = /^[^\d\s]+[\d]*$/; /* no numbers, no beginning whitespace */
 const dateRegex        = /^\d{4}-\d{2}-\d{2}/;
 const zipRegex         = /^\d{5}(-\d{4}|-?$)/; /* 12345 or 12345-6789 */