How do I use format controls? I want to make sure people write the telephone number correctly.

 

Image 096

 

The PJ system uses Regular Expressions for format control rules. To find them in your system click here.

~~~~~~~~~~~

The PJ System offers some starter regexps, but you can create more, by creating a format. To find or build regexps click on one of the following links:

General info
https://en.wikipedia.org/wiki/Regular_expression
Tutorials
http://www.regular-expressions.info/
Testing site
https://regex101.com/
Library
http://www.regexlib.com/)
Advise forum
http://regexadvice.com/forums/default.aspx

~~~~~~~~~~~

Video: Using Format Control

 

Here are some examples:

#\+?\d{0,3}?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}?#

Allows any of the following:

+1 333 333 3333
+44 333.333.3333
44 333-333-3333
+345 (333) 333.3333
333.333.3333
333-333-3333
(333) 333.3333

~~~~~~~~~~~~~~~~~

#\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}?#

Allows any of the following:

333 333 3333
333.333.3333
333-333-3333
(333) 333.3333

~~~~~~~~~~~~~~~~~

#\+\d{0,3}\s\(0\)\s\d{4}\s\d{6}#

Allows any of the following:

+123 (0) 1234 567890
+11 (0) 1234 567890
+1 (0) 1234 567890

~~~~~~~~~~~~~~~~~

#\+44\s\(0\)\s\d{4}\s\d{6}#

Allows only the following:

+44 (0) 1234 567890

~~~~~~~~~~~

#^\d{2}$#

Forces user to write 2 numbers and only 2:

66

Incidentally, the ^ (Shift 6) means that the string must start here and $ means it must stop here.

~~~~~~~~~~~

For more help please email support@printjob.com

Comments are closed.