Skip to content

Commit ef671e0

Browse files
committed
Update README.md
1 parent daba17e commit ef671e0

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

README.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,27 @@ simple regular expression module for lua.
1313
luarocks install regex
1414
```
1515

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.
3016

17+
***
3118

32-
## Creating a Regex object
3319

34-
### re, err = regex.new( pattern [, flgs] )
20+
## re, err = regex.new( pattern [, flgs] )
3521

3622
creates a new regex object.
3723

3824
**Parameters**
3925

4026
- `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.
4237

4338
**Returns**
4439

@@ -65,8 +60,6 @@ end
6560
```
6661

6762

68-
## Instance Methods
69-
7063

7164
## arr, err = regex:match( sbj [, offset] )
7265

@@ -85,7 +78,7 @@ matches a compiled regular expression against a given subject string. It returns
8578

8679
## arr, err = regex:matches( sbj [, offset] )
8780

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**.
8982

9083
**Parameters**
9184

0 commit comments

Comments
 (0)