Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to make RegEx compilation quiet (i.e. not print an error to stdout). #10381

Closed
Germenzi opened this issue Aug 6, 2024 · 1 comment
Milestone

Comments

@Germenzi
Copy link

Germenzi commented Aug 6, 2024

Describe the project you are working on

Search field, wich allows user to search using regex.

Describe the problem or limitation you are having in your project

Currently there is no way to hide regex compilation error, so if regex code provided by user, one can't validate it without error printing in stdout.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a second parameter to RegEx.compile and RegEx.create_from_string named show_error with true default value.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Samples:

var regex := RegEx.create_from_string("abc)") # pritns "3: unmatched closing parenthesis" to debugger
var regex_quiet := RegEx.create_from_string("abc)", false) # no prints

Same in RegEx.compile

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

N/A

@akien-mga
Copy link
Member

Implemented by godotengine/godot#95212.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants