julz / importas

linter to enforce consistent import aliases
Apache License 2.0
14 stars 12 forks source link

Can't use non capturing group in the alias #8

Closed tomfeigin closed 2 years ago

tomfeigin commented 2 years ago

It seems that the library uses the : token to parse the input causing it to wrongly parse regexes with non capturing groups.

Example:

-alias k8s.io/apimachinery/pkg/(?:api/)?(\w+):k8$1

Error:

importas: error parsing regexp: invalid or unsupported Perl syntax:(?$``