8d6e1a41a5Fixed bug where a repeated capturing group eg. (a){3} wouldn't capture only the last iteration, like it shouldAadhavan Srinivasan2024-12-16 22:58:39 -0500
332c2fe5a2Made lookarounds a little more efficient by only matching from (or to, in the case of lookbehind) the current indexAadhavan Srinivasan2024-12-11 00:31:08 -0500
437ca2ee57Improved submatch tracking by storing all group indices as a part of the state, which is viewed as a 'thread'Aadhavan Srinivasan2024-12-11 00:16:24 -0500
00902944f6Added code to match capturing groups and store into a Group (used to be MatchIndex)Aadhavan Srinivasan2024-12-09 01:28:18 -0500
11f7f1d746Added fields to state, to determine capturing group information. 0th group refers to entire matchAadhavan Srinivasan2024-12-09 01:05:01 -0500
745fab9639Clone lookaroundNFA when cloning a state; use compiled regex for lookarounds instead of compiling a new oneAadhavan Srinivasan2024-11-27 12:15:21 -0500
34e9aedbd6Compile lookaround regex to avoid compiling each time we want to use itAadhavan Srinivasan2024-11-27 12:15:01 -0500
6208f32710Added support for numeric ranges: <5-38> will match all numbers between 5 and 38, inclusive on both ends. Also print line number on which matches occur, if we are in printing (and single line) modeAadhavan Srinivasan2024-11-27 11:48:04 -0500
cbd6ea136bIf the NFA starts with an assertion, make sure it's true before doing anything else. Also, check for last-state _lookaround_ rather than just last state, before breaking (instead of aborting) when the assertion failsAadhavan Srinivasan2024-11-27 11:46:38 -0500
eb6a044ecfAdded angle brackets to list of special characters (which need to be escaped to be used literallyAadhavan Srinivasan2024-11-27 11:45:27 -0500
393769f152Accounted for last character being a newline when checking for EOS (we can be at the second-last character if the last one is a newlineAadhavan Srinivasan2024-11-27 11:44:39 -0500
e36310b32dAdded function (and helper functions) to generate a regex that matches all numbers in a rangeAadhavan Srinivasan2024-11-27 11:43:57 -0500
0de3a94ce3Fixed bug with lookaheads: f(?=f) would not match anything in 'ffa', because of the 'a' at the end of the string. Fixed by checking if there are other last states when an assertion fails, rather than immediately abortingAadhavan Srinivasan2024-11-24 15:04:51 -0500
fe1136c54cFixed bug with parentheses in lookaround regex; fixed bug with reading last line of test string (if it doesn't end in a newline)Aadhavan Srinivasan2024-11-24 15:02:58 -0500
77d19cd84eAdded lookaround-related fields to State struct, added lookaround support to checkAssertion()Aadhavan Srinivasan2024-11-22 00:11:51 -0500
051a8551f3Match zero-length match at end of string, even if the start node is an assertion (end of string, lookarounds, etc.)Aadhavan Srinivasan2024-11-22 00:10:58 -0500
11c0a0552fAdded support for lokarounds; parsing and adding nodes for different lookaroundsAadhavan Srinivasan2024-11-22 00:10:15 -0500
c807d6664eChanged generation of characters for non-whitespace, non-digit and non-word characters - it's basically an inverted character class nowAadhavan Srinivasan2024-11-20 10:39:24 -0500
e882f41400Added fields to denote all the characters that an 'allChars' postfixNode _shouldn't_ represent (useful for inverting character classes)Aadhavan Srinivasan2024-11-20 09:41:32 -0500
b3ee1fe5e8Convert an inverting character class into an 'allChars' node, with the characters marked as exceptionsAadhavan Srinivasan2024-11-20 09:40:40 -0500
708a9e1303Added field to denote all characters which an 'allChars' node _shouldn't_ match (useful for invertinc character classesAadhavan Srinivasan2024-11-20 09:39:24 -0500
c694c47be7Added flag to print match indices, and to enable multi-line modeAadhavan Srinivasan2024-11-20 01:06:23 -0500
992c5a9300Replaced isAlphaNum() with isNormalChar(), which returns true if the character isn't special (also returns true for unicode characters, which the previous function didn'tAadhavan Srinivasan2024-11-20 00:24:43 -0500
805766a5baAdded support for -l : only print lines with at least one match (or with exactly 0 matches, if -v is enabledAadhavan Srinivasan2024-11-18 10:02:25 -0500
f2b8812b05Added support for -v flag, to invert which values are printed in color. Also got rid of unecessary 'else' clauseAadhavan Srinivasan2024-11-17 22:19:55 -0500
11641596faRead multiple lines from stdin and apply regex to each one; Convert the array of matchIndex structs into a flat array of indices; speeds up process of checking if we have to print a character in colorAadhavan Srinivasan2024-11-17 21:49:11 -0500
7d265495f5Got rid of list for uniq_arr (O(n) deletion) and instead have separate method to create list (O(n) list creation)Aadhavan Srinivasan2024-11-07 15:55:13 -0500
e2e99ff6a9Added fnunction to generate numbers in a range; added capacity to some slices to prevent unnecessary reallocationsAadhavan Srinivasan2024-11-06 15:16:51 -0500
8a69ea8cb7Added unique array data structure - O(1) addition and retrieval (I think)Aadhavan Srinivasan2024-11-06 15:13:35 -0500
21142e6e13Wrote function to clone the NFA starting at a given state, and a function to find question mark operator (a? == (a|))Aadhavan Srinivasan2024-11-03 14:37:38 -0500
b602295beeAdded support for specifying how often a postfixNode is repeatedAadhavan Srinivasan2024-11-03 14:36:56 -0500
1d9d1a5b81Fixed calculation of overlapping (used to check for subset instead)Aadhavan Srinivasan2024-11-03 14:36:23 -0500
d8f52b8cccAdded support for numeric specifiers, moved question mark operator to its own functionAadhavan Srinivasan2024-11-03 14:36:04 -0500
dca81c1796Replaced rune-slice parameters with string parameters in functions; avoids unnecessary conversion from strings to rune-slicesAadhavan Srinivasan2024-11-01 01:53:50 -0400
1aff6e2fa4Added a field to State, that tells me what kind of assertion (if any) it is making. Also added function to check if a state's contents contain a given value (checks assertions), and to find all matches that a state has for a characterAadhavan Srinivasan2024-10-31 17:13:34 -0400
f3bf5e9740Added function to check for word boundaries and delete an element from a sliceAadhavan Srinivasan2024-10-31 17:09:25 -0400
7b815343f4Removed exclamation mark in inverted metacharacters - had the opposite effect becasue of the way deleteFunc worksAadhavan Srinivasan2024-10-29 10:07:55 -0400