@@ -13,32 +13,27 @@ simple regular expression module for lua.
13
13
luarocks install regex
14
14
```
15
15
16
- ***
17
-
18
-
19
- ## Regular expression flags
20
-
21
- - ` i ` : Do caseless matching.
22
- - ` s ` : ` . ` matches anything including NL.
23
- - ` m ` : ` ^ ` and ` $ ` match newlines within data.
24
- - ` u ` : Treat pattern and subjects as UTF strings.
25
- - ` U ` : Do not check the pattern for ` UTF ` valid.
26
- - ` x ` : Ignore white space and ` # ` comments.
27
- - ` o ` : compile-once mode that caching a compiled regex.
28
- - ` g ` : global match.
29
- - ` j ` : enable JIT compilation.
30
16
17
+ ***
31
18
32
- ## Creating a Regex object
33
19
34
- ### re, err = regex.new( pattern [ , flgs] )
20
+ ## re, err = regex.new( pattern [ , flgs] )
35
21
36
22
creates a new regex object.
37
23
38
24
** Parameters**
39
25
40
26
- ` pattern:string ` : string containing expression to be compiled.
41
- - ` flgs:string ` : [ regular expression flags] ( #regular-expression-flags ) .
27
+ - ` flgs:string ` : regular expression flags that can be combined with any of the following characters.
28
+ - ` i ` : Do caseless matching.
29
+ - ` s ` : ` . ` matches anything including NL.
30
+ - ` m ` : ` ^ ` and ` $ ` match newlines within data.
31
+ - ` u ` : Treat pattern and subjects as UTF strings.
32
+ - ` U ` : Do not check the pattern for ` UTF ` valid.
33
+ - ` x ` : Ignore white space and ` # ` comments.
34
+ - ` o ` : compile-once mode that caching a compiled regex.
35
+ - ` g ` : global match.
36
+ - ` j ` : enable JIT compilation.
42
37
43
38
** Returns**
44
39
65
60
```
66
61
67
62
68
- ## Instance Methods
69
-
70
63
71
64
## arr, err = regex: match ( sbj [ , offset] )
72
65
@@ -85,7 +78,7 @@ matches a compiled regular expression against a given subject string. It returns
85
78
86
79
## arr, err = regex: matches ( sbj [ , offset] )
87
80
88
- almost same as ` match ` method but it returns all matched substrings except capture strings.
81
+ almost same as ` match ` method but it returns all matched substrings ** except capture strings** .
89
82
90
83
** Parameters**
91
84
0 commit comments