The current regex pattern ^([\w\d]+:){2,} used for identifier parsing does not correctly handle strings that contain hyphens, such as solana-action:. The pattern is limited to word characters and digits, excluding hyphens, resulting in failed matches for identifiers with hyphens.
To resolve this, the regex needs to be updated to ^([\w\d\-]+:){2,}, which will include hyphens in the character class. Updating the regex pattern and corresponding test cases will ensure that all valid identifiers are correctly matched.
Steps to Reproduce:
Use the current regex ^([\w\d]+:){2,} on a string containing a hyphen, like solana-action:.
Observe that the pattern fails to match.
Expected Behavior:
The regex should correctly match strings with hyphens in identifiers.
Proposed Solution:
Update the regex to ^([\w\d\-]+:){2,} and modify test cases accordingly.
Impact:
This affects all functionality relying on correct identifier parsing, potentially causing errors or missed matches in critical components.
Description:
The current regex pattern
^([\w\d]+:){2,}
used for identifier parsing does not correctly handle strings that contain hyphens, such assolana-action:
. The pattern is limited to word characters and digits, excluding hyphens, resulting in failed matches for identifiers with hyphens.To resolve this, the regex needs to be updated to
^([\w\d\-]+:){2,}
, which will include hyphens in the character class. Updating the regex pattern and corresponding test cases will ensure that all valid identifiers are correctly matched.Steps to Reproduce:
^([\w\d]+:){2,}
on a string containing a hyphen, likesolana-action:
.Expected Behavior:
The regex should correctly match strings with hyphens in identifiers.
Proposed Solution:
Update the regex to
^([\w\d\-]+:){2,}
and modify test cases accordingly.Impact:
This affects all functionality relying on correct identifier parsing, potentially causing errors or missed matches in critical components.