{"id":18141,"date":"2015-03-27T11:00:51","date_gmt":"2015-03-27T11:00:51","guid":{"rendered":"https:\/\/www.snapsurveys.com\/support-snap11\/?page_id=18141"},"modified":"2019-10-01T08:46:14","modified_gmt":"2019-10-01T07:46:14","slug":"using-scanning-validation-patterns","status":"publish","type":"page","link":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/","title":{"rendered":"Using scanning validation patterns"},"content":{"rendered":"<p>&nbsp;<\/p>\n<section>\n<p class=\"bodytext\">Patterns are a description of what characters you expect to be in an open response variable. You have to define them for each variable that uses them.<\/p>\n<div class=\"read-more-content\">\n<p>There are two types of scanning validation in Snap, \u2018<strong>Spelling<\/strong>\u2018 and \u2018<strong>Patterns<\/strong>\u2018.<\/p>\n<ul>\n<li><strong>Spelling<\/strong> validation checks a response against a stored dictionary of words, and tries to match responses to words in the dictionary.<\/li>\n<li><strong>Pattern validation<\/strong> depends on you creating the pattern of characters that you expect a response to be. It is most useful for responses such as dates, telephone number and zip codes.<\/li>\n<\/ul>\n<p>There are different versions of spelling and pattern validation for handwritten and printed characters.<\/p>\n<p>You can create one or more scanning validation patterns for each variable in your survey. Each pattern matches an expected response. You create a pattern by telling Snap how many of which characters you are expecting.<\/p>\n<p>For example, you could create several scanning patterns for a phone number.<\/p>\n<ul>\n<li>A pattern that just expects the digits 0 &#8211; 9<\/li>\n<li>A pattern that expects a + as the first character<\/li>\n<li>A pattern that allows you to have the characters +, ( and ) as well as digits<\/li>\n<\/ul>\n<p>The software would then check through each pattern in turn to see if it could match the scanned characters to the ones in the pattern, for example, it would assume that \u201cl\u201d was a one, rather than a lower case L.<\/p>\n<\/div>\n<p><a class=\"button radius read-more-show hide\">See more &gt;<\/a><a class=\"button radius read-more-hide hide\">Hide this content &gt;<\/a><br \/>\nThis worksheet provides:<\/p>\n<ul>\n<li>Some standard scanning validation patterns with instructions on adding them to your variables <a href=\"#opta\">(See Option A)<\/a><\/li>\n<li>Instructions on creating your own validation pattern for a simple user ID <a href=\"#optb\">(See Option B)<\/a><\/li>\n<\/ul>\n<\/section>\n<div id=\"SetPattern\"><\/div>\n<section>\n<h3>Set a variable to use a pattern<\/h3>\n<div class=\"read-more-content\">\n<ol>\n<li>Open the survey in <strong>Questionnaire<\/strong> mode.<\/li>\n<li>Select the question that you wish to apply the pattern to (e.g. one asking \u201c<em>What is the phone number?<\/em>\u201d)<\/li>\n<li>Press [Alt]+[Enter] to display the <strong>Variable Properties<\/strong> dialog.<\/li>\n<li>Scroll to display the <strong>Scanning Validation<\/strong> property and change it from <strong>None<\/strong> to <strong>Pattern<\/strong>. This is the pattern for hand-written response.\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18142\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/vp_scanv_pat.png\" alt=\"vp_scanv_pat\" width=\"294\" height=\"378\" \/><\/p>\n<\/div>\n<\/li>\n<li>Click OK to close the Variable Properties and then open the Variables window.<\/li>\n<li>Locate the variable in the list which you set to Pattern and double click to open the Variable Details window.<\/li>\n<li>Click on the Toggle Definitions icon and you will see Pattern selected in the Scanning Validation dropdown list.<\/li>\n<li>Click on the button with 3 dots to open the <strong>Pattern Match List<\/strong> dialog which lists all existing patterns for this question (currently none).\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18143\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pml_dial.png\" alt=\"pml_dial\" width=\"420\" height=\"239\" \/><\/p>\n<\/div>\n<\/li>\n<\/ol>\n<\/div>\n<p><a class=\"button radius read-more-show hide\">Tell me how to do this &gt;<\/a><a class=\"button radius read-more-hide hide\">Hide this content &gt;<\/a><\/p>\n<\/section>\n<div id=\"opta\"><\/div>\n<section>\n<h3>Option A: Apply a sample pattern<\/h3>\n<p>You can create patterns by pasting pattern definitions in the design field. This step supplies some example patterns for dates, zip\/post codes and phone numbers and shows you how to paste them in.<\/p>\n<div class=\"read-more-content\">\n<ol>\n<li><a href=\"#SetPattern\">Set a variable to use a pattern<\/a><\/li>\n<li>Click <strong>[New&#8230;]<\/strong> on the <strong>Pattern Match List<\/strong> dialog to create a pattern.\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18144\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pml_dial_new.png\" alt=\"pml_dial_new\" width=\"420\" height=\"239\" \/><\/p>\n<\/div>\n<\/li>\n<li>The <strong>Pattern Match Details<\/strong> dialog opens. Use [Ctrl]+[C] to copy the sample pattern text that you require from the \u2018<em>Sample Scanning validation patterns<\/em>\u2019 table below step 10. Please note that there should be no line breaks.<\/li>\n<li>Use [Ctrl]+[V] to paste the pattern text into the <strong>Pattern<\/strong> field.<\/li>\n<li>Copy the text in the pattern to replace column if you wish to convert the response into a standard format. Paste this into the <strong>Replace With<\/strong> field.\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18145\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pmd_pasted.png\" alt=\"pmd_pasted\" width=\"456\" height=\"420\" \/><\/p>\n<\/div>\n<\/li>\n<li>Click <strong>[OK]<\/strong> to save the pattern.<\/li>\n<li>Create any other patterns that you wish to use with on this variable (for example, add another phone number format). You can test multiple patterns by clicking <strong>[Test All]<\/strong> on the patterns list and then entering sample responses.<\/li>\n<li>Once you have tested your patterns are working correctly, click <strong>[OK]<\/strong> to return to the <strong> Variable Details<\/strong> window.<\/li>\n<li>Click <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-17568\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/01\/save.png\" alt=\"save\" width=\"21\" height=\"17\" \/> to save the changes.<\/li>\n<\/ol>\n<h3>Sample scanning validation patterns<\/h3>\n<table class=\"tableintopic\" style=\"border-collapse: collapse;\" border=\"0\" width=\"906\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"315\">\n<p class=\"tabletight\"><b class=\"menuinstruction\">Definition<\/b><\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\"><b class=\"menuinstruction\">Pattern to copy<\/b><\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"32\">\n<p class=\"tabletight\"><b class=\"menuinstruction\">Pattern to replace (optional)<\/b><\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"listcontinue\"><b class=\"menuinstruction\">Effect of replacement<\/b><\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\"><b class=\"menuinstruction\">US ZIP code patterns<\/b><\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\"><\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\"><\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\"><\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">5-digit ZIP code<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">\\d{5}<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\"><\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\"><\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">5+4 digit ZIP code (separator is any non-numeric)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">(\\d{5})\\D(\\d{4})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1-\\2<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Enforces &#8220;-&#8221; between parts of ZIP code<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">2 character state code with optional space and 5-digit ZIP code<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">([A~Za~z]{2})\\s?(\\d{5})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1 \\2<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Enforces space between characters and digits<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">2 character state code with optional space and 5+4 digit ZIP code<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">([A~Za~z]{2})\\s?(\\d{5})\\D(\\d{4})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1 \\2-\\3<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Enforces space between characters and digits and &#8220;-&#8221; between parts of ZIP code<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\"><b class=\"menuinstruction\">UK Postcode patterns<\/b><\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\"><\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\"><\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\"><\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">Area and district (one or two letters followed by one or two digits) optional space, sector and unit<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">([A~Za~z]{1,2})(\\d{1,2})\\s?(\\d)([A~Za~z]{2})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1\\2 \\3\\4<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Enforces space between district and sector<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">Area and district (one or two letters followed by one digit and one letter) optional space, sector and unit<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">([A~Za~z]{2})(\\d[A~Za~z]{1})\\s?(\\d)([A~Za~z]{2})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1\\2 \\3\\4<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Enforces space between district and sector<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\"><b class=\"menuinstruction\">Date patterns<\/b><\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\"><\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\"><\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\"><\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">4 &#8211; 6 digit date (1 or 2 day and month digits and 2 year digits). Valid for US or UK dates<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">(\\d{1,2})\\D(\\d{1,2})\\D(\\d{2})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1-\\2-\\3<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Places &#8220;-&#8221; as a separator between elements of date. For a different separator, replace &#8220;-&#8221; with your chosen character.<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">6 -8 digit date (1 or 2 day and month digits and 4 year digits). Valid for US or UK dates<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">(\\d{1,2})\\D(\\d{1,2})\\D(\\d{4})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1-\\2-\\3<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Places &#8220;-&#8221; as a separator between elements of date. For a different separator, replace &#8220;-&#8221; with your chosen character.<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\"><b class=\"menuinstruction\">UK Phone number patterns<\/b><\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\"><\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\"><\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\"><\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">0 plus 9 or 10 digits with spaces permitted anywhere (e.g. 01424 280 800)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">0\\s?(\\d)\\s?(\\d)\\s?(\\d)\\s?(\\d)\\s?(\\d)\\s?(\\d)\\s?(\\d)\\s?(\\d)\\s?(\\d)\\s?(\\d)\\s?(\\d?)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">0\\1\\2\\3\\4\\5\\6\\7\\8\\9\\10<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Remove all optional spaces (would give 01424280800)<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">UK number with brackets (e.g. (01424) 280 800)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">\\((\\d{3,6})\\)\\s?(\\d{3})\\s?(\\d{2,4})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1\\2\\3<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Remove brackets and optional spaces (would give 01424280800)<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">International number e.g. +44 1424 28000)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">\\+44\\s?(\\d{2,6})\\)?\\s?(\\d{3})\\s?(\\d{2,4})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">0\\1\\2\\3<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Remove international code and optional spaces (would give 01424280800)<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">International number with &#8220;(0)&#8221; (e.g. +44 (0) 1424 28000)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">\\+44\\s?\\(0\\)\\s?(\\d{2,6})\\)?\\s?(\\d{3})\\s?(\\d{2,4})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">0\\1\\2\\3<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Remove international code and optional spaces (would give 01424280800)<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\"><b class=\"menuinstruction\">US phone number patterns<\/b><\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\"><\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\"><\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\"><\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">7 digit number with optional spaces or dashes (e.g. 610-8700)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">(\\d{3})[ -\\~]?\\d{4})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1-\\2<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Replace optional spaces with dashes<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">10 digit phone number with optional brackets spaces or dashes (e.g. (603) 610 8700)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">\\(?(\\d{3})\\)?[ -\\~]?(\\d{3})[ -\\~]?(\\d{4})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1-\\2-\\3<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Remove brackets and replace optional spaces (would give 603-610-8700)<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">International number (e.g. +1-603-610 -8700)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">\\+1[ -\\~]?\\(?(\\d{3})\\)?[ -\\~]?(\\d{3})[ -\\~]?(\\d{4})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1-\\2-\\3<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Remove international code and brackets and replace optional spaces (would give 603-610-8700)<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\"><b class=\"menuinstruction\">Value for currency<\/b><\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\"><\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\"><\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\"><\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">Number of any length with no decimal places (e.g. 123)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">(\\d+)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1.00<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Add empty decimal places (123.00)<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">Number of any length with decimal point and two decimal places (e.g. 123,45)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">(\\d+)[ &#8216;\\*\\,~\\._~`\\~](\\d{2})<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">\\1.\\2<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Remove any non-standard decimal point character and replace with &#8220;.&#8221; (123.45)<\/p>\n<\/td>\n<\/tr>\n<tr align=\"left\" valign=\"top\">\n<td style=\"border-right: 1px solid #010101;\" width=\"174\">\n<p class=\"tabletight\">One or two digits with pence marker (e.g. 34p)<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">(\\d{1,2})[Pp]\n<\/td>\n<td style=\"border-left: 1px solid #010101; border-right: 1px solid #010101;\" width=\"132\">\n<p class=\"tabletight\">00.\\1<\/p>\n<\/td>\n<td style=\"border-left: 1px solid #010101;\" width=\"300\">\n<p class=\"tabletight\">Convert value into decimal place (0.34)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><a class=\"button radius read-more-show hide\">Tell me how to do this &gt;<\/a><a class=\"button radius read-more-hide hide\">Hide this content &gt;<\/a><\/p>\n<\/section>\n<div id=\"optb\"><\/div>\n<section>\n<h3>Option B: Set up your own validation pattern<\/h3>\n<p>This section shows how to create a simple validation pattern. The example is a pattern for an ID of two digits followed by five letters (digits can be separated from the letters by a space). The pattern removes spaces from the ID before entering the response in Snap.<\/p>\n<div class=\"read-more-content\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Set a variable to use a pattern.<\/li>\n<li><strong>Click [New&#8230;]<\/strong> on the<strong> Pattern Match List<\/strong> dialog to create a pattern.\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18164\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pml_dial_new1.png\" alt=\"pml_dial_new\" width=\"420\" height=\"239\" \/><\/p>\n<\/div>\n<\/li>\n<li>The <strong>Pattern Match Details<\/strong> dialog opens. Click the button with 3 dots to the right of the <strong>Pattern<\/strong> field to open the <strong>Pattern Item<\/strong> dialog.\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18165\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pmd_empty_hl.png\" alt=\"pmd_empty_hl\" width=\"456\" height=\"420\" \/><\/p>\n<\/div>\n<\/li>\n<li>Define the first element to match in your pattern. This will be two digits.Select <strong>Digit (0 to 9)<\/strong>.\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18166\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pi_2_dig.png\" alt=\"pi_2_dig\" width=\"489\" height=\"382\" \/><\/p>\n<\/div>\n<p>Set the repetitions to be <strong>Exactly 2<\/strong> in the <strong>Repetition<\/strong> area.<br \/>\nSelect <strong>Remember<\/strong>. This means that you will be able to replace parts of the pattern.<\/li>\n<li>Click <strong>[OK]<\/strong> to return to the <strong>Pattern Match Details<\/strong> dialog. The pattern item is described in the <strong>Description<\/strong>. It\u2019s remembered as item \\<strong>1<\/strong> and looks for 2 digits.\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18167\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pmd_2_curs_hl.png\" alt=\"pmd_2_curs_hl\" width=\"331\" height=\"174\" \/><\/p>\n<\/div>\n<\/li>\n<li>Now to insert a pattern item for a possible space. Put the cursor in the <strong>Pattern<\/strong> field at the end of the text and click the button with 3 dots again. Select <strong>Space<\/strong>.\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18168\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pi_sp_0-.png\" alt=\"pi_sp_0+\" width=\"489\" height=\"382\" \/><\/p>\n<\/div>\n<p>Set the repetitions to be <strong>0 or more<\/strong> in the <strong>Repetition<\/strong> area.<\/li>\n<li>Click<strong> [OK]<\/strong> to save that part of your pattern.<\/li>\n<li>Now to define the letters in the pattern. Put the cursor in the Pattern field at the end of the text and click the button with dots again. Click \u201cA\u201d, hold down [Shift] and then click \u201cZ\u201d in the list of possible characters.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18169\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pi_caps.png\" alt=\"pi_caps\" width=\"489\" height=\"382\" \/><\/p>\n<\/div>\n<p>Set the repetitions to be <strong>Exactly 5 <\/strong>in the Repetition area.<br \/>\nSelect <strong>Remember<\/strong>.<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Click <strong>[OK]<\/strong> to save this part of your pattern. This part of the pattern is remembered as item \\2 and looks for 5 characters.<\/li>\n<li>Enter <strong>\\1\\2 <\/strong>in the <strong>Replace With<\/strong> field of the <strong>Pattern Match Details<\/strong> dialog. The <strong>\\1 <\/strong>refers to your first remembered pattern item and the <strong>\\2<\/strong> refers to the second remembered pattern. Any spaces are discarded.<\/li>\n<li>Enter a sample user ID in the <strong>Test<\/strong> field. Any spaces that separate the numbers from the letters will be removed in the <strong>Replace<\/strong> field. This shows what would happen to scanned text in the survey. The <strong>Replace<\/strong> text will be stored in Snap.\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-18170\" src=\"https:\/\/www.snapsurveys.com\/support-snap11\/wp-content\/uploads\/2015\/03\/pmd_uid_test.png\" alt=\"pmd_uid_test\" width=\"456\" height=\"420\" \/><\/p>\n<\/div>\n<\/li>\n<li>Click<strong> [OK]<\/strong> to save your pattern.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><em>If you want to use this pattern on other variables, you can copy the pattern definition text and paste it into a new pattern as described in <\/em>Option A: Apply a sample pattern.<\/p>\n<\/div>\n<p><a class=\"button radius read-more-show hide\">Tell me how to do this &gt;<\/a><a class=\"button radius read-more-hide hide\">Hide this content &gt;<\/a><\/p>\n<\/section>\n<h3>Further reading<\/h3>\n<p>The Getting Started with Scanning guide describes how to set up spelling validation (for handwritten answers). It also has an example: <a href=\"https:\/\/www.snapsurveys.com\/help\/index.htm#32221\" target=\"_blank\" rel=\"noopener\">Setting up quantity questions for scanning<\/a>.<\/p>\n<p>The help includes a topic on <a href=\"https:\/\/www.snapsurveys.com\/help\/index.htm#32224\" target=\"_blank\" rel=\"noopener\">setting up a scanning validation pattern for a name<\/a>.<\/p>\n<p>The terms you can enter directly in the pattern definition field are defined in the topic: <a href=\"https:\/\/www.snapsurveys.com\/help\/index.htm#21670\" target=\"_blank\" rel=\"noopener\">Pattern matching expressions<\/a>.<\/p>\n<p class=\"bodytext\">If there is a topic you would like a worksheet on, email to <a class=\"\" title=\"\" href=\"mailto:snapideas@snapsurveys.com\" target=\"_self\">snapideas@snapsurveys.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><a class=\"ninja_pages_read_more\"  href=\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/\"><\/a><\/p>\n","protected":false},"author":33,"featured_media":0,"parent":43,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"page-templates\/child-page.php","meta":{"_acf_changed":false,"footnotes":""},"class_list":{"0":"post-18141","1":"page","2":"type-page","3":"status-publish","5":"search_category-support-hub"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using scanning validation patterns - Snap Surveys<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using scanning validation patterns - Snap Surveys\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/\" \/>\n<meta property=\"og:site_name\" content=\"Snap Surveys\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SnapSurveys\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-01T07:46:14+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@snapsurveys\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/\",\"name\":\"Using scanning validation patterns - Snap Surveys\",\"isPartOf\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/#website\"},\"datePublished\":\"2015-03-27T11:00:51+00:00\",\"dateModified\":\"2019-10-01T07:46:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.snapsurveys.com\/support-snap11\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Worksheets\",\"item\":\"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Using scanning validation patterns\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/#website\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snap11\/\",\"name\":\"Snap Surveys\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.snapsurveys.com\/support-snap11\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using scanning validation patterns - Snap Surveys","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_GB","og_type":"article","og_title":"Using scanning validation patterns - Snap Surveys","og_url":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/","og_site_name":"Snap Surveys","article_publisher":"https:\/\/www.facebook.com\/SnapSurveys","article_modified_time":"2019-10-01T07:46:14+00:00","twitter_card":"summary_large_image","twitter_site":"@snapsurveys","twitter_misc":{"Estimated reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/","url":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/","name":"Using scanning validation patterns - Snap Surveys","isPartOf":{"@id":"https:\/\/www.snapsurveys.com\/support-snap11\/#website"},"datePublished":"2015-03-27T11:00:51+00:00","dateModified":"2019-10-01T07:46:14+00:00","breadcrumb":{"@id":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/using-scanning-validation-patterns\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.snapsurveys.com\/support-snap11\/"},{"@type":"ListItem","position":2,"name":"Worksheets","item":"https:\/\/www.snapsurveys.com\/support-snap11\/worksheets\/"},{"@type":"ListItem","position":3,"name":"Using scanning validation patterns"}]},{"@type":"WebSite","@id":"https:\/\/www.snapsurveys.com\/support-snap11\/#website","url":"https:\/\/www.snapsurveys.com\/support-snap11\/","name":"Snap Surveys","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.snapsurveys.com\/support-snap11\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/18141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/comments?post=18141"}],"version-history":[{"count":10,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/18141\/revisions"}],"predecessor-version":[{"id":29485,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/18141\/revisions\/29485"}],"up":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/43"}],"wp:attachment":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/media?parent=18141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}