Fixing up the regex a tiny bit

This commit is contained in:
Andrew S. Rightenburg 2023-08-24 10:31:10 -04:00
parent c164f4acf8
commit 0b5960f575
Signed by: rail5
GPG Key ID: A0CB570AB6629159
2 changed files with 6 additions and 2 deletions

View File

@ -166,7 +166,7 @@ void reader::file::do_regex_search() {
TODO:
At the moment, it's also possible to construct situations in which there is a match present, but Polonius will not be able to find it.
Consider the expression:
[C-Z]{2}E
([C-Z]{2})E
Run on a file with the contents:
0ABCDEFGHIJKLMNOPQRSTUVWXYZ
With a block size of 4 bytes

View File

@ -173,7 +173,11 @@ std::vector<std::string> parse_regex(std::string expression) {
curly_braces_received_comma = false;
curly_braces_buffer += part;
parsed_expression[current_index] += curly_braces_buffer;
if (multi_char_entry) {
parsed_expression[current_index] += curly_braces_buffer;
} else {
parsed_expression.push_back(curly_braces_buffer);
}
curly_braces_buffer = "";
} else {