codewriter-packages / Tri-Inspector

Free inspector attributes for Unity [Custom Editor, Custom Inspector, Inspector Attributes, Attribute Extensions]
MIT License
972 stars 47 forks source link

Add Regex validation attribute #104

Closed HoSHIZA closed 1 year ago

HoSHIZA commented 1 year ago

image

vanifatovvlad commented 1 year ago

Hi @HoSHIZA , can you provide a real-world example that requires a dynamic regex? This functionality looks unnecessary, but complicates the code

HoSHIZA commented 1 year ago

Hi @vanifatovvlad, I agree that this thing is very specific, but sometimes this functionality can be really useful. For example, in my project, in one ScriptableObject I set a regular expression that I use in other places that refer to that SO, and it's very convenient to change that regex without any code edits. I can remove the dynamic regex part if necessary, but personally I think someone could use it as much as I do.

vanifatovvlad commented 1 year ago

Thanks for the contribution, however I decide not to add this attribute to the main package. If you need this attribute you can create your own repository and add this attribute there as the inspector supports external extensions