GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenXPKI::Server::Workflow::Validator::Regex(3) User Contributed Perl Documentation OpenXPKI::Server::Workflow::Validator::Regex(3)

OpenXPKI::Server::Workflow::Validator::Regex

Validates the context value referenced by argument against a regex. The regex can be passed either as second argument or specified in the param section. The value given as argument is always preferred.

    class: OpenXPKI::Server::Workflow::Validator::Regex
    arg:
     - $link
     - email

    class: OpenXPKI::Server::Workflow::Validator::Regex
    arg:
     - $link
    param:
        regex: "\\A http(s)?://[a-zA-Z0-9-\\.]+"
        modifier: xi
        error: Please provide a well-formed URL starting with http://
        field: link

regex
The regex must be given as pattern without delimiters and modifiers. The default modifier is "xi" (case-insensitive, whitespace pattern), you can override it using the key "modifier" in the param section. (@see http://perldoc.perl.org/perlre.html#Modifiers).

Some common formats can also be referenced by name:

email
Basic check for valid email syntax
fqdn
A fully qualified domain name, must have at least one dot, all "word" characters are accepted for the domain parts. Last domain part must have at least two characters
href
A lightweight check for a URI to be used as href target, valid if the string starts with http(s):// followed by fqdn. The check is "open ended", so it allows arbitrary sequences after something that looks like a valid FQDN.
modifier
error
The error parameter is optional, if set this is shown in the UI if the validator fails instead of the default message.
field
As the validator only received the value, it does not know which field holds the faulty input. If you pass the name of the input field here the UI will highlight the field with the error.

Note: You still need to pass the value as argument to the validator as there is no way to get it from the field name.

2022-05-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.