Skip to content

syntax: RegEx literal rule is bad #14

@Alexey-T

Description

@Alexey-T
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. 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions