Thanks to everyone for the answers, I learned something new about regex, but that did not help my needs. Maybe I was not specific enough in this matter.
I really wanted to process the sequences sequentially. I need a regex engine where I can pass in an arbitrary regex pattern and query if the next user input is valid (based on all previous inputs), and I would like to get the character set that is possible for the next char for auto-completion mechanisms.
//pseudo code
void main(string[] args){
Regex regex = new Regex("^1(2|3)4$");
RegexProcessor processor = new RegexProcessor(regex);
bool step1 = processor.Input('1'); //return true and iterates to next step
char[] validInput = processor.GetValidInput(); //returns new char[]{'2','3'}
bool step2 = processor.Input('4'); //return false because on step2 (2|3) is accepted
}
:
, DFA/NFA.
https://github.com/moodmosaic/Fare
, , , . , , .
BasicOperation.Run( a, s) , IsMatch .
Regex
lib , . , , . - , . , . DFA/NFA, , , , .