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

syntax: RegEx literal rule is bad #14

Open
Alexey-T opened this issue Sep 18, 2021 · 0 comments
Open

syntax: RegEx literal rule is bad #14

Alexey-T opened this issue Sep 18, 2021 · 0 comments

Comments

@Alexey-T
Copy link

Alexey-T commented Sep 18, 2021

string email = "[email protected]";
if (/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.match(email)) {
    stdout.printf("Valid email address\n");
}

this REGEX literal is not highlited.
NOTE!
after the closing /, regex may have chars: ismx (lowercase).

The following trailing characters can be used:

    i, letters in the pattern match both upper- and lowercase letters

    m, the "start of line" and "end of line" constructs match immediately following or immediately before any newline in the string, respectively, as well as at the very start and end.

    s, a dot metacharater . in the pattern matches all characters, including newlines. Without it, newlines are excluded.

    x, whitespace data characters in the pattern are totally ignored except when escaped or inside a character class. 
@Alexey-T Alexey-T changed the title RegEx string rule is bad syntax: RegEx literal rule is bad Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant