1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 """Module containing various shared docstrings."""
24
25
26
27 from user_functions.objects import Desc_container
28
29
30
31 regexp_doc = Desc_container("Regular expression")
32 regexp_doc.add_paragraph("The python function 'match', which uses regular expression, is used to determine which data type to set values to, therefore various data_type strings can be used to select the same data type. Patterns used for matching for specific data types are listed below.")
33 regexp_doc.add_paragraph("This is a short description of python regular expression, for more information see the regular expression syntax section of the Python Library Reference. Some of the regular expression syntax used in this function is:")
34 regexp_doc.add_item_list_element("'[]'", "A sequence or set of characters to match to a single character. For example, '[sS]2' will match both 'S2' and 's2'.")
35 regexp_doc.add_item_list_element("'^'", "Match the start of the string.")
36 regexp_doc.add_item_list_element("'$'", "Match the end of the string. For example, '^[Ss]2$' will match 's2' but not 'S2f' or 's2s'.")
37 regexp_doc.add_item_list_element("'.'", "Match any character.")
38 regexp_doc.add_item_list_element("'x*'", "Match the character 'x' any number of times, for example 'x' will match, as will 'xxxxx'.")
39 regexp_doc.add_item_list_element("'.*'", "Match any sequence of characters of any length.")
40 regexp_doc.add_paragraph("Importantly, do not supply a string for the data type containing regular expression. The regular expression is implemented so that various strings can be supplied which all match the same data type.")
41