Normal
Currently all regular expressions used inside our MDEs are hard coded. There are requests to make them extensible:Question at [USER=17886]@MJGraf[/USER]:did you already implement a serialization for Regex instances?This we would need for putting them into settings and sending them to server (via ServerSettings).I could also image some more attributes like[CODE=XML]<Pattern Enabled="True" Code="(?<series>[^\\]*)\\[^\\]*(?<seasonnum>\d+)[^\\]*\\S*(?<seasonnum>\d+)[EX](?<episodenum>\d+)*(?<episode>.*)\." Option="IgnoreCase" />[/CODE]the "Enabled" attribute could be used for temporary disabling patterns without needing them to be removed/commented from code. Construction of an RegExp by (string, RegexOptions) is possible when we deserialize this type. With a custom class we probably not even need to implement own XML serialization, just using strings and enum and creating the RegEx instance once both properties are set.How should the extension be provided to users? Once the serialization is implemented, the user could manually edit .xml files inside configf folder. Would that be enough for advanced users?If not, how could a GUI in MP2 could look like to edit RegExs?The change itself is quite easy to make, but a config GUI would be quite complicated I think.[USERGROUP=39]@Developers[/USERGROUP] [USERGROUP=40]@Testers[/USERGROUP]
Currently all regular expressions used inside our MDEs are hard coded. There are requests to make them extensible:
Question at [USER=17886]@MJGraf[/USER]:
did you already implement a serialization for Regex instances?
This we would need for putting them into settings and sending them to server (via ServerSettings).
I could also image some more attributes like
[CODE=XML]<Pattern Enabled="True" Code="(?<series>[^\\]*)\\[^\\]*(?<seasonnum>\d+)[^\\]*\\S*(?<seasonnum>\d+)[EX](?<episodenum>\d+)*(?<episode>.*)\." Option="IgnoreCase" />[/CODE]
the "Enabled" attribute could be used for temporary disabling patterns without needing them to be removed/commented from code. Construction of an RegExp by (string, RegexOptions) is possible when we deserialize this type. With a custom class we probably not even need to implement own XML serialization, just using strings and enum and creating the RegEx instance once both properties are set.
How should the extension be provided to users? Once the serialization is implemented, the user could manually edit .xml files inside configf folder. Would that be enough for advanced users?
If not, how could a GUI in MP2 could look like to edit RegExs?
The change itself is quite easy to make, but a config GUI would be quite complicated I think.
[USERGROUP=39]@Developers[/USERGROUP] [USERGROUP=40]@Testers[/USERGROUP]