Skip to content

My attempted to write the start of a regex system. Prompted by a Q on LeetCode. It is also to help understand compilers a bit more.

Notifications You must be signed in to change notification settings

whimax07/MaxRegex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MaxRegex

My attempted to write the start of a regex system. Prompted by a Q on LeetCode. It is also to help understand compilers a bit more.

How To Run

To run simple regex use SimpleRegex. To run the more elaborate version of regex use the api in MaxRegex.

Example

Simple Regex

import src.regex.SimpleRegex;
        
String testString = "AABBCC";
String pattern = "AAB+C.";
SimpleRegex regex = new SimpleRegex(testString, pattern);

// 'matches' will be true.
boolean matches = regex.matches();

Elaborate Regex

import src.regex.MaxRegex;

String testString = "AABBCC";
String pattern = "AAB+C.";

// 'matches' will be true.
boolean matches = MaxRegex.whollyContainedIn(pattern, testString);

About

My attempted to write the start of a regex system. Prompted by a Q on LeetCode. It is also to help understand compilers a bit more.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages