Skip to content

Improve regex error messages #83

Description

@Baptouuuu

In the RegExp class the error messages in exceptions is either the pattern or an empty string but uses preg_last_error() as exception code to classify the error. This is not optimal to quickly debug an invalid regex.

Instead preg_last_error_msg() should be used as exception messages to better pinpoint what's wrong. The use of the exception code must be kept as is to still allow to classify the errors (to prevent a BC break).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions