Compare commits
2 Commits
e608101951
...
e4b81bf64e
Author | SHA1 | Date | |
---|---|---|---|
e4b81bf64e | |||
67c59b0789 |
44
README.md
44
README.md
@ -1 +1,45 @@
|
||||
# Jëger
|
||||
A regex engine.
|
||||
|
||||
### Syntax
|
||||
The aim was to follow Vim's regex syntax. Esoteric special characters such as "\zs" are not implemented, however the just is supported.
|
||||
| :----: | :---------------------: |
|
||||
| Symbol | Meaning (TODO: fill in) |
|
||||
| :----: | :---------------------: |
|
||||
| . | |
|
||||
| = | |
|
||||
| + | |
|
||||
| * | |
|
||||
| ? | |
|
||||
| \\< | |
|
||||
| \\> | |
|
||||
| ^ | |
|
||||
| \t | |
|
||||
| \n | |
|
||||
| \b | |
|
||||
| \i | |
|
||||
| \I | |
|
||||
| \k | |
|
||||
| \K | |
|
||||
| \f | |
|
||||
| \F | |
|
||||
| \p | |
|
||||
| \P | |
|
||||
| \s | |
|
||||
| \d | |
|
||||
| \D | |
|
||||
| \x | |
|
||||
| \X | |
|
||||
| \o | |
|
||||
| \O | |
|
||||
| \w | |
|
||||
| \W | |
|
||||
| \h | |
|
||||
| \a | |
|
||||
| \l | |
|
||||
| \L | |
|
||||
| \u | |
|
||||
| \U | |
|
||||
| [\<range\>] | |
|
||||
| [\^\<range\>] | |
|
||||
| :----: | :---------------------: |
|
||||
|
@ -352,6 +352,43 @@ int escape_to_negative(const char c,
|
||||
cs->flags |= IS_NEGATIVE;
|
||||
return sizeof(digit_chars)-1;
|
||||
};
|
||||
case 'X': {
|
||||
const char hex_chars[] = JEGER_CHAR_SET_digits
|
||||
JEGER_CHAR_SET_lower_hex
|
||||
JEGER_CHAR_SET_upper_hex
|
||||
;
|
||||
strcpy(cs->blacklist, hex_chars);
|
||||
cs->flags |= IS_NEGATIVE;
|
||||
return sizeof(hex_chars)-1;
|
||||
};
|
||||
case 'O': {
|
||||
const char oct_chars[] = JEGER_CHAR_SET_octal_digits;
|
||||
strcpy(cs->blacklist, oct_chars);
|
||||
cs->flags |= IS_NEGATIVE;
|
||||
return sizeof(oct_chars)-1;
|
||||
};
|
||||
case 'W': {
|
||||
const char word_chars[] = JEGER_CHAR_SET_underscore
|
||||
JEGER_CHAR_SET_digits
|
||||
JEGER_CHAR_SET_lower
|
||||
JEGER_CHAR_SET_upper
|
||||
;
|
||||
strcpy(cs->blacklist, word_chars);
|
||||
cs->flags |= IS_NEGATIVE;
|
||||
return sizeof(word_chars)-1;
|
||||
};
|
||||
case 'L': {
|
||||
const char lower_alpha_chars[] = JEGER_CHAR_SET_lower;
|
||||
strcpy(cs->blacklist, lower_alpha_chars);
|
||||
cs->flags |= IS_NEGATIVE;
|
||||
return sizeof(lower_alpha_chars)-1;
|
||||
};
|
||||
case 'U': {
|
||||
const char upper_alpha_chars[] = JEGER_CHAR_SET_upper;
|
||||
strcpy(cs->blacklist, upper_alpha_chars);
|
||||
cs->flags |= IS_NEGATIVE;
|
||||
return sizeof(upper_alpha_chars)-1;
|
||||
};
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user