https://github.com/hyouteki/irregex
Regex expression matcher in c for the subset of conventional regex
https://github.com/hyouteki/irregex
c regex regex-matcher
Last synced: 3 months ago
JSON representation
Regex expression matcher in c for the subset of conventional regex
- Host: GitHub
- URL: https://github.com/hyouteki/irregex
- Owner: hyouteki
- License: gpl-3.0
- Created: 2024-05-23T11:00:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-23T11:21:33.000Z (about 1 year ago)
- Last Synced: 2025-02-13T06:01:43.218Z (3 months ago)
- Topics: c, regex, regex-matcher
- Language: C
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IRREGular EXpression
Regex expression matcher in c for the subset of conventional regex.## Syntax
| Expression | Match clause |
| :-: | :- |
| c | matches any literal character `c` |
| . | matches any single character |
| ^ | matches the beginning of the input string |
| $ | matches the end of the input string |
| c* | matches zero or more occurrences of the character `c` |
| .*c | matches zero or more of any character until `c` |
| .*\0 | matches zero or more of any character until the end of input string |
| *c | matches zero or more of any character until `c` from the start of input string |## Quick Start
``` bash
make
make test
```## Examples
``` console
irregex "Hello .* " "Hello nosferatu Hello ninthcircle"
> Hello nosferatuirregex "ir*e.ex" "irrrrrregex"
> irrrrrregex
```## References
- [A Regular Expression Matcher - Brian Kernighan](https://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html)