Skip to content

Commit ce95add

Browse files
authored
Update README.md
Update readme with explanation of invalid codes
1 parent 78ce0da commit ce95add

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ The main API is modelled around Fortran's `index` intrinsic function (which perf
1414
result = REGEX(string, pattern, length)
1515
```
1616

17-
If no substrings with the given patterns are found, or the pattern is invalid, `result = 0`. Otherwise, if the pattern was found `result > 0` equal to the leftmost location inside the string where the pattern can be found.
17+
- If the pattern command is invalid, `result = -1`.
18+
- If no substrings with the given pattern are found, with a valid pattern `result = 0`. This is also returned if the string has zero length, and that is an acceptable answer for the input pattern.
19+
- Otherwise, if the pattern was found `result > 0` equal to the leftmost location inside the string where the pattern can be found. `length` returns the number of consecutive characters that match this pattern
1820

1921
### Object-oriented interface
2022

0 commit comments

Comments
 (0)