From: dbs Date: Fri, 29 May 2009 19:53:10 +0000 (+0000) Subject: Use Unicode-friendly regular expressions for registering and retrieving patrons by... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f7db7f578e6fbab4e3942ae7235f7d39c986af83;p=evergreen%2Fbjwebb.git Use Unicode-friendly regular expressions for registering and retrieving patrons by name 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 --- diff --git a/Open-ILS/xul/staff_client/server/patron/search_form.js b/Open-ILS/xul/staff_client/server/patron/search_form.js index 72211296b..76759047c 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_form.js +++ b/Open-ILS/xul/staff_client/server/patron/search_form.js @@ -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 != '') { diff --git a/Open-ILS/xul/staff_client/server/patron/ue_config.js b/Open-ILS/xul/staff_client/server/patron/ue_config.js index 5761b7991..e4c3fd405 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue_config.js +++ b/Open-ILS/xul/staff_client/server/patron/ue_config.js @@ -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 */