OpenQuizz
Une application de gestion des contenus pédagogiques
regex Class Reference
Inheritance diagram for regex:
Collaboration diagram for regex:

Public Member Functions

def __init__ (self, pattern, flags=0)
 
def __call__ (self, value)
 
def __deepcopy__ (self, memo)
 

Data Fields

 pattern
 
 re
 

Detailed Description

Validate a string based on a regular expression.

Example::

    parser = reqparse.RequestParser()
    parser.add_argument('example', type=inputs.regex('^[0-9]+$'))

Input to the ``example`` argument will be rejected if it contains anything
but numbers.

:param pattern: The regular expression the input must match
:type pattern: str
:param flags: Flags to change expression behavior
:type flags: int

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  pattern,
  flags = 0 
)

Member Function Documentation

◆ __call__()

def __call__ (   self,
  value 
)

◆ __deepcopy__()

def __deepcopy__ (   self,
  memo 
)

Field Documentation

◆ pattern

pattern

◆ re

re

The documentation for this class was generated from the following file: