vala-lang / vala-vscode

Vala and Genie integration for Visual Studio Code/VSCodium/Code-OSS
MIT License
41 stars 9 forks source link

syntax: RegEx literal rule is bad #14

Open Alexey-T opened 3 years ago

Alexey-T commented 3 years ago
string email = "tux@kernel.org";
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.