IluvatarTheReal / POTMLogParser

Log compiler made for parsing the log output from the Ravenloft POTM module.
0 stars 0 forks source link

Use regex to match patterns #2

Open IluvatarTheReal opened 3 years ago

IluvatarTheReal commented 3 years ago

String patterns and information are found manually through many manipulation of the string, change that so we use regex instead to find the part of the string with the information we seek.

It's cleaner and easier to understand, read and modify later if changes are made to the output in the log. The regex can also easily be reused to match similar information in other places in the code.

IluvatarTheReal commented 3 years ago

Some information is now fetch using regex, certain things still needs to bed one with regex, however, since lookbehind features is not available in regex with c++, I'm reconsidering the use of regex since it causes the regular expression to be more complex, or forces us to trim the result of the match afterward if we keep simple regular expression.