Version 1.0
Copyright © 2022 Lowell D. Thomas
Python APG
 … an ABNF Parser Generator
Variables
examples.exp.multiline Namespace Reference

Variables

string title
 
string pattern = 'line = beg "The " animal " in the hat." end\n'
 
string input = 'The cat in the hat.\n'
 
string header = 'RESULT'
 
int testno = 0
 
string re_pattern = r'^The (cat|dog|bird|mouse) in the hat.$'
 
 matches = re.finditer(re_pattern, input, re.M)
 
 end
 
 exp = ApgExp(pattern, 'g')
 
 result = exp.exec(input)
 

Variable Documentation

◆ end

examples.exp.multiline.end

Definition at line 37 of file multiline.py.

◆ exp

examples.exp.multiline.exp = ApgExp(pattern, 'g')

Definition at line 47 of file multiline.py.

◆ header

string examples.exp.multiline.header = 'RESULT'

Definition at line 29 of file multiline.py.

◆ input

string examples.exp.multiline.input = 'The cat in the hat.\n'

Definition at line 25 of file multiline.py.

◆ matches

examples.exp.multiline.matches = re.finditer(re_pattern, input, re.M)

Definition at line 34 of file multiline.py.

◆ pattern

string examples.exp.multiline.pattern = 'line = beg "The " animal " in the hat." end\n'

Definition at line 19 of file multiline.py.

◆ re_pattern

string examples.exp.multiline.re_pattern = r'^The (cat|dog|bird|mouse) in the hat.$'

Definition at line 33 of file multiline.py.

◆ result

examples.exp.multiline.result = exp.exec(input)

Definition at line 48 of file multiline.py.

◆ testno

int examples.exp.multiline.testno = 0

Definition at line 30 of file multiline.py.

◆ title

string examples.exp.multiline.title
Initial value:
1 = '''This example will demonstrate how to mimick
2 the multi-line mode flag of regex.
3 '''

Definition at line 13 of file multiline.py.

Python APG, Version 1.0, is licensed under the 2-Clause BSD License,
an Open Source Initiative Approved License.