We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The original regex was [1-2][0-9]{3}\-[0-1][0-9]\-[0-3][0-9]
[1-2][0-9]{3}\-[0-1][0-9]\-[0-3][0-9]
But the contant regex in the general sol had an extra escape character. string public constant regex = "[1-2][0-9]{3}\\-[0-1][0-9]\-[0-3][0-9]";
string public constant regex = "[1-2][0-9]{3}\\-[0-1][0-9]\-[0-3][0-9]";
The text was updated successfully, but these errors were encountered:
I don't see the difference between your two examples? The string should have extra escape characters for the constant to appear properly.
Is the matching behavior broken? Or is the problem just with the constant?
Sorry, something went wrong.
I edited the comment above. Yes, the problem is only with the constant having an extra backslash. Only the first one.
You need to escape the backslash in a solidity string literal. For example:
ParserError: Expected string end-quote. | | const foo = "\"; | ^^^^
No branches or pull requests
The original regex was
[1-2][0-9]{3}\-[0-1][0-9]\-[0-3][0-9]
But the contant regex in the general sol had an extra escape character.
string public constant regex = "[1-2][0-9]{3}\\-[0-1][0-9]\-[0-3][0-9]";
The text was updated successfully, but these errors were encountered: