Beginning to add regex search functionality to polonius-reader

This commit is contained in:
Andrew S. Rightenburg 2023-08-23 22:59:55 -04:00
parent e81ed794ac
commit b32dba2e23
Signed by: rail5
GPG Key ID: A0CB570AB6629159
2 changed files with 10 additions and 0 deletions

View File

@ -133,6 +133,7 @@ void reader::file::do_regex_search() {
/***
TODO:
A regex search in Polonius should happen this way:
0. Validate the regular expression
1. Parse the regular expression into its component parts
e.g.:
Expression: 'abc[a-z]+235'

View File

@ -62,6 +62,15 @@
#include "../../shared/process_bytecodes.cpp"
#endif
/* vector<string> parse_regex(string expression) splits a regular expression into its component parts */
/* e.g.: parse_regex("[a-z]+123") returns { "[a-z]+", "1", "2", "3" } */
/* vector<string> create_sub_expressions(string expression) [same file] runs parse_regex() and then recombines the parts into smaller expressions */
/* e.g.: create_sub_expressions("[a-z]+123") returns { "[a-z]+12", "[a-z]+1", "[a-z]+" } */
#ifndef FN_PARSE_REGEX
#define FN_PARSE_REGEX
#include "../../shared/parse_regex.cpp"
#endif
/* Contains the 'meat' of the program */
#include "namespace_reader.h"
#include "class_file.cpp"