Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
GerbenAaltink committed Sep 28, 2024
1 parent b3c4458 commit 61c537b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This is a KISS/YAGNI regex validator.
Supports 95% of commonly used regex syntax.
- It is faster in matching than the original C `reg_exec`. Also excluding compilation (`reg_comp`).
- Extracts contents.
- Original concept is from Rob Pike and mentioned in the book "Beautiful Code" written by Andy Oram and Greg Wilson.

## Supported functions
Expand All @@ -16,7 +17,7 @@ Support for:
- "*". Match must contain zero or more of previous character. Greedy.
- "[abc]". Match one of these chars. Does NOT work in combination with greedy matching (`*+`).

## Minimal usage matching
## Usage matching
`rmatch(char * expr, char ** str)` is the main function. It returns int[3].
If you have a `char *` as str argument, don't forget to add the `&`.
The return value contains:
Expand All @@ -26,7 +27,7 @@ result[1] // match start.
result[2] // match length.
```

## Minimal usage extracting
## Usage extracting
`rmatch_extract(char * expr, char * str)` is the main function. It returns char * or NULL.
If you have a `char *` as str argument, don't forget to add the `&`.
You can use it in a loop since it uses the pointer of the input string:
Expand Down

0 comments on commit 61c537b

Please sign in to comment.