< Summary

Information
Class: MyNet.Text.RegexPatterns
Assembly: MyNet.Text
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Text/RegexPatterns.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 34
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Text/RegexPatterns.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="RegexPatterns.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.Text.RegularExpressions;
 8
 9namespace MyNet.Text;
 10
 11/// <summary>
 12/// Provides common regex patterns for text validation and matching.
 13/// </summary>
 14public static partial class RegexPatterns
 15{
 16    /// <summary>
 17    /// Gets a precompiled regex pattern for validating email addresses.
 18    /// Matches email addresses with a local part, "@" symbol, and domain part.
 19    /// </summary>
 320    public static Regex EmailPattern { get; } = GetEmailRegex();
 21
 22    /// <summary>
 23    /// Gets a precompiled regex pattern for validating phone numbers.
 24    /// Matches phone numbers with optional country code, area code, and extension.
 25    /// </summary>
 326    public static Regex PhonePattern { get; } = GetPhoneRegex();
 27
 28    [GeneratedRegex(@"^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d
 29    private static partial Regex GetEmailRegex();
 30
 31    [GeneratedRegex(@"^(\+\s?)?((?<!\+.*)\(\+?\d+([\s\-\.]?\d+)?\)|\d+)([\s\-\.]?(\(\d+([\s\-\.]?\d+)?\)|\d+))*(\s?(x|ex
 32    private static partial Regex GetPhoneRegex();
 33}
 34

Methods/Properties

.cctor()