This website works better with JavaScript.
e07f27dc78
Merge branch 'master' of https://gitea.twomorecents.org/Rockingcool/kleingrep
master
Aadhavan Srinivasan
2025-02-24 07:46:54 -0500
65d2317f79
Added more backreference tests
Aadhavan Srinivasan
2025-02-21 08:44:33 -0500
a631fc289c
Clone 'isBackreference' and 'referredGroup' NFA fields, because they aren't thread variables
Aadhavan Srinivasan
2025-02-21 08:44:24 -0500
d62a429cce
Updated documentation
Aadhavan Srinivasan
2025-02-20 19:58:07 -0500
7b31031553
Change when a newline is printed; so that we don't print extraneous newlinesraneous newlines
Aadhavan Srinivasan
2025-02-17 09:37:31 -0500
38c842cb07
Added method to get length of unique array
Aadhavan Srinivasan
2025-02-17 09:36:38 -0500
9f9af36be8
Fixed bug where escaped parentheses in lookarounds were counted as regular parentheses instead of literals
Aadhavan Srinivasan
2025-02-17 09:36:17 -0500
8217b67122
Added test for escaped parentheses in lookarounds
Aadhavan Srinivasan
2025-02-17 09:34:54 -0500
1f06dcef64
Just declare the variable instead of initializing it as well
Aadhavan Srinivasan
2025-02-16 15:51:53 -0500
119475b41b
Updated README
Aadhavan Srinivasan
2025-02-14 12:13:01 -0500
6151cc8cf6
Updated documentation
v0.3.0
Aadhavan Srinivasan
2025-02-14 12:07:43 -0500
3eaf4eb19c
Updated README
Aadhavan Srinivasan
2025-02-14 12:00:33 -0500
d453815831
Added README
Aadhavan Srinivasan
2025-02-14 11:59:43 -0500
3a2916baae
Set 'isLazy' to true in the NFA, if the postfixNode has the flag set
Aadhavan Srinivasan
2025-02-14 11:37:48 -0500
9d6344719f
Reverse order of trying branches if the quantifier is lazy
Aadhavan Srinivasan
2025-02-14 11:37:28 -0500
f5c868566b
Added field to NFA, denoting if a node is lazy or not
Aadhavan Srinivasan
2025-02-14 11:37:14 -0500
1cd6da218f
Added lazy quantifier tests
Aadhavan Srinivasan
2025-02-14 11:36:56 -0500
277cbc0fc5
Started working on lazy quantifier support
Aadhavan Srinivasan
2025-02-13 20:50:30 -0500
3924502b72
Added code to return lazy quantifier postfixNodes
Aadhavan Srinivasan
2025-02-13 20:50:11 -0500
36b009747b
Added metacharacters for lazy quantifiers
Aadhavan Srinivasan
2025-02-13 20:49:54 -0500
6cd0a10a8f
Added more documentation
Aadhavan Srinivasan
2025-02-13 14:14:00 -0500
69fb96c43d
Merge pull request 'Implement Unicode character classes' (#4 ) from implementUnicodeCharClass into master
Aadhavan Srinivasan
2025-02-13 09:51:44 -0600
46bc0c8529
Removed unicode character classes from 'features not supported' list
#4
implementUnicodeCharClass
Aadhavan Srinivasan
2025-02-13 10:48:23 -0500
1a890a1e75
Refactoring - remove duplicate code
Aadhavan Srinivasan
2025-02-13 09:10:40 -0500
fde3784e5a
Added unicode charclass support within character classes; Fixed bugs with hex classes and unicode classes
Aadhavan Srinivasan
2025-02-13 08:58:02 -0500
7045711860
Convert test_str into a rune slice for better unicode compatibility, it also fixed the bug where all unicode characters wouldn't be colored
Aadhavan Srinivasan
2025-02-13 08:55:41 -0500
d4d606d95b
Added tests for unicode character classes; more tests for hex characters
Aadhavan Srinivasan
2025-02-13 08:55:12 -0500
9cd330e521
More work on unicode character class support - fix bug where all characters aren't being matched
Aadhavan Srinivasan
2025-02-12 23:04:10 -0500
44d6a2005c
Started working on unicode character classes
Aadhavan Srinivasan
2025-02-12 22:19:30 -0500
f76cd6c3d9
Merge pull request 'Implement Backreferences' (#3 ) from implementBackreferences into master
Aadhavan Srinivasan
2025-02-12 21:17:32 -0600
375baa1722
Wrote more backreference tests
#3
implementBackreferences
Aadhavan Srinivasan
2025-02-12 07:51:20 -0500
2e47c631bb
Updated documentation to include backreferences
Aadhavan Srinivasan
2025-02-12 07:50:24 -0500
81b8b1b11c
Do not validate a backreference if the group that it refers to is not valid
Aadhavan Srinivasan
2025-02-11 19:12:58 -0500
2934e7a20f
Wrote tests for backreferences
Aadhavan Srinivasan
2025-02-11 19:12:40 -0500
f466d4a8d5
More progress on backreference implementation
Aadhavan Srinivasan
2025-02-11 17:06:39 -0500
8327450dd2
Started implementing backreferences (octal values should now be prefaced with \0)
Aadhavan Srinivasan
2025-02-11 16:14:48 -0500
073f231b89
Added function and examples for ReplaceAllFunc()
v0.2.0
Aadhavan Srinivasan
2025-02-10 21:35:51 -0500
3b7257c921
Wrote function and example for ReplaceAllLiteral()
Aadhavan Srinivasan
2025-02-10 21:25:49 -0500
668df8b70a
Wrote MarshalText() and UnmarshalText() to implement TextMarshaler and TextUnmarshaler
Aadhavan Srinivasan
2025-02-10 12:30:48 -0500
214acf7e0f
Wrote example for ReplaceAll(); fixed out-of-bounds bug in Expand()
Aadhavan Srinivasan
2025-02-10 12:30:17 -0500
50221ff4d9
Wrote ReplaceAll(), to replace all matches of the regex with a given string
Aadhavan Srinivasan
2025-02-10 12:29:54 -0500
5ab95f512a
Updated docs
Aadhavan Srinivasan
2025-02-10 09:36:00 -0500
e7da678408
Removed obsolete documentation
Aadhavan Srinivasan
2025-02-10 09:35:16 -0500
ab363e2766
Rewrote test for 'FindString()' to use lookarounds
Aadhavan Srinivasan
2025-02-10 09:24:47 -0500
c803e45415
Added example for 'FindStringSubmatch()'
Aadhavan Srinivasan
2025-02-10 09:19:24 -0500
525296f239
Added examples for 'FindAllString()' , 'FindAllSubmatch()' and 'FindAllStringSubmatch()'
Aadhavan Srinivasan
2025-02-10 09:10:39 -0500
eb0ab9f7ec
Wrote test for FindAllStringSubmatch()
Aadhavan Srinivasan
2025-02-10 08:39:20 -0500
17a7dbae4c
Wrote FindAllStringSubmatch()
Aadhavan Srinivasan
2025-02-10 08:39:10 -0500
f2279acd98
Fixed mistake in docs
Aadhavan Srinivasan
2025-02-10 08:12:09 -0500
662527c478
Merge pull request 'Implement PCRE Matching (prefer left-branch)' (#2 ) from implementPCREMatchingRules into master
v0.1.0
Aadhavan Srinivasan
2025-02-09 15:24:26 -0600
d1958f289c
Commented out tests that would only pass with Longest()
#2
implementPCREMatchingRules
Aadhavan Srinivasan
2025-02-09 16:08:16 -0500
15ee49f42e
Rename method receivers from 'regex' to 're' (it's shorter)
Aadhavan Srinivasan
2025-02-09 15:51:46 -0500
b60ded4136
Don't break when a match is found, if we are looking for the longest match
Aadhavan Srinivasan
2025-02-09 15:48:33 -0500
9fbb99f86c
Wrote example for Longest()
Aadhavan Srinivasan
2025-02-09 15:47:57 -0500
af15904f3b
Updated documentation
Aadhavan Srinivasan
2025-02-09 15:41:13 -0500
d522f50b50
Wrote new example functions
Aadhavan Srinivasan
2025-02-09 15:40:59 -0500
fb47e082eb
Wrote new methods Expand() and preferLongest(); Use new function signatures (with preferLongest); only characters should be added to next state list
Aadhavan Srinivasan
2025-02-09 15:39:35 -0500
1f5a363539
Use new function signatures (with preferLongest)
Aadhavan Srinivasan
2025-02-09 15:39:09 -0500
9e12f9dcb3
Added field to Reg, denoting if we prefer longest match (POSIX style) or not (perl style)
Aadhavan Srinivasan
2025-02-09 15:38:26 -0500
47f88c817f
Fixed typo
Aadhavan Srinivasan
2025-02-09 15:14:17 -0500
835d495990
Removed capitalization for error message (staticcheck)
Aadhavan Srinivasan
2025-02-09 09:14:45 -0500
76e0170cb9
Removed unused function
Aadhavan Srinivasan
2025-02-09 09:13:52 -0500
d172a58258
Throw error if match isn't found but test.result has >0 elements
Aadhavan Srinivasan
2025-02-09 09:13:29 -0500
7231169270
Removed unused functions
Aadhavan Srinivasan
2025-02-09 09:13:03 -0500
e546f01c20
Removed redundant return (staticcheck)
Aadhavan Srinivasan
2025-02-09 09:12:55 -0500
b7467a00f1
Removed priorityQueue (unused)
Aadhavan Srinivasan
2025-02-09 09:07:43 -0500
c6ad4caa0d
Removed a bunch of unused code (let's go!!!)
Aadhavan Srinivasan
2025-02-09 09:06:40 -0500
6334435b83
Updated tests since the engine uses Perl matching instead of POSIX matching; added tests for FindStringSubmatch
Aadhavan Srinivasan
2025-02-09 09:01:42 -0500
78fb5606dd
Use new definition of Reg
Aadhavan Srinivasan
2025-02-09 08:59:16 -0500
eddd2ae700
Updated documentation
Aadhavan Srinivasan
2025-02-09 08:58:58 -0500
c577064977
Added string field to Reg, that contains the expression string; wrote method to return the string
Aadhavan Srinivasan
2025-02-09 08:58:46 -0500
d4e3942d27
Added Match() and FindStringSubmatch(); removed old code; updated comments
Aadhavan Srinivasan
2025-02-09 08:58:09 -0500
f15a5cae34
Store all states visited in a single run of 'addStateToList()' in a slice
Aadhavan Srinivasan
2025-02-08 16:07:01 -0500
62ca1a872a
Made zeroLengthMatchState() return a pointer; reduced the number of comparisons performd by nfaState.equals
Aadhavan Srinivasan
2025-02-08 16:06:14 -0500
99230b49de
Use new function signature for zeroLengthMatchState()
Aadhavan Srinivasan
2025-02-08 16:05:35 -0500
22ead83625
Fixed assertion matching
Aadhavan Srinivasan
2025-02-07 16:19:36 -0500
3604486a9b
Used Pike's algorithm (an extension to Thompson's algorithm) (see Russ Cox's 2nd article); I think I almost have a working PCRE-style engine
Aadhavan Srinivasan
2025-02-07 16:06:45 -0500
052de55826
question() now returns 2 values
Aadhavan Srinivasan
2025-02-07 16:04:46 -0500
d2ad0d95a8
Modified question operator so that it doesn't create an unnecessary zero-state
Aadhavan Srinivasan
2025-02-07 16:04:26 -0500
ccf3b3b299
More progress on implementing PCRE matching
Aadhavan Srinivasan
2025-02-06 22:08:56 -0500
1d4f695f8f
Wrote function to check if a state is in an nfaState, based on the Equals function
Aadhavan Srinivasan
2025-02-06 22:06:51 -0500
8534174ea1
Use pointers instead of values
Aadhavan Srinivasan
2025-02-06 22:06:22 -0500
ed4ffde64e
REFACTOR NEEDED: Added another special case; insert instead of appending into currentStates
Aadhavan Srinivasan
2025-02-05 22:51:55 -0500
fbc9bea9fb
Commented out unused functions; use new nfaState parameters
Aadhavan Srinivasan
2025-02-05 22:23:31 -0500
cca8c7cda2
Got rid of transitions parameter, changed how kleene state is processed
Aadhavan Srinivasan
2025-02-05 22:20:28 -0500
858e535fba
Continued implementing Thompson's algorithm
Aadhavan Srinivasan
2025-02-05 18:01:36 -0500
7c62ba6bfd
Started implementing Thompson's algorithm for matching, because the old one was completely backtracking (so it would enter infinite loops on something like '(a*)*' )
Aadhavan Srinivasan
2025-02-05 12:21:04 -0500
d4e8cb74fd
Replaced pointer to nfaState with nfaState
Aadhavan Srinivasan
2025-02-05 11:32:20 -0500
3ce611d121
More work towards implementing PCRE matching
Aadhavan Srinivasan
2025-02-04 14:09:24 -0500
e0253dfaf3
Change kleene() to an alternation-style construct
Aadhavan Srinivasan
2025-02-04 14:09:04 -0500
753e973d82
Started rewrite of matching algorithm, got concatenation and alternation done, kleene and zero-state stuff is next
origin/implementPCREMatchingRules
Aadhavan Srinivasan
2025-02-03 22:00:04 -0500
5563a70568
Reverse the order in which I pop states for alternation, because this messes with the left branch-right branch thing
Aadhavan Srinivasan
2025-02-03 21:59:41 -0500
de0d7345a8
Store left and right branches of alternation separately
Aadhavan Srinivasan
2025-02-03 21:59:05 -0500
ad273b0c68
Trying to emulate backtracking by using string pointers within threads (something similar to rsc's 2nd regexp article)
Aadhavan Srinivasan
2025-02-03 16:50:11 -0500
e167cdb2cb
Fixed mistake in test output
Aadhavan Srinivasan
2025-02-03 16:49:30 -0500
1fd48ae614
Store the current string pointer as a 'thread variable' (allows us to simulate backtracking)
Aadhavan Srinivasan
2025-02-03 16:49:10 -0500
09812956ac
Disable all optimizations
Aadhavan Srinivasan
2025-02-03 16:48:09 -0500
fbc9dfcc95
Trying something out; we'll see if it works
Aadhavan Srinivasan
2025-02-03 16:47:53 -0500
bc32e0cb76
Started working on converting to PCRE matching rules (prefer left branch of alternation)
Aadhavan Srinivasan
2025-02-03 14:06:14 -0500
ad0f7d0178
Added new state fields to tell if a state is a question or alternation
Aadhavan Srinivasan
2025-02-03 14:05:53 -0500