Soenneker.Validators.Phone.Possible 11.0.334

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Validators.Phone.Possible --version 11.0.334
                    
NuGet\Install-Package Soenneker.Validators.Phone.Possible -Version 11.0.334
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Validators.Phone.Possible" Version="11.0.334" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Validators.Phone.Possible" Version="11.0.334" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Validators.Phone.Possible" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Validators.Phone.Possible --version 11.0.334
                    
#r "nuget: Soenneker.Validators.Phone.Possible, 11.0.334"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Validators.Phone.Possible@11.0.334
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Validators.Phone.Possible&version=11.0.334
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Validators.Phone.Possible&version=11.0.334
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Validators.Phone.Possible

Parses phone numbers and checks libphonenumber's region-specific validity metadata.

Install

dotnet add package Soenneker.Validators.Phone.Possible

Registration

using Soenneker.Validators.Phone.Possible.Registrars;
using Microsoft.Extensions.DependencyInjection;

services.AddPhonePossibleValidatorAsSingleton();

Scoped registration is also available. Both registrations reuse the singleton libphonenumber utility, so a scoped validator can be released without rebuilding the shared metadata-backed client.

Parse a number

using PhoneNumbers;
using Soenneker.Validators.Phone.Possible.Abstract;

PhoneNumber? parsed = await validator.Parse(
    "+1 312-555-0187",
    defaultRegion: "US",
    cancellationToken);

The default region is used to interpret national-format input. International input beginning with + carries its own country calling code. Expected libphonenumber parse failures return null; cancellation while obtaining the shared utility and unexpected runtime failures propagate.

Validate raw or parsed input

bool? validRaw = await validator.Validate(
    "312-555-0187",
    defaultRegion: "US",
    cancellationToken);

bool? validParsed = await validator.Validate(
    parsed!,
    defaultRegion: "US",
    cancellationToken);

The raw overload returns false when parsing fails. Both overloads call PhoneNumberUtil.IsValidNumberForRegion; despite the package name, they do not call IsPossibleNumber. Region validity is stricter than a length-only possibility check and requires the parsed number to belong to the requested region.

The nullable Boolean return type is retained by the API, but the current validation implementations return only true or false.

Static access

bool? valid = PhonePossibleValidator.ValidateStatic(parsed!, "US");

The static method uses libphonenumber's process-wide instance directly. Prefer the injected API when consistent dependency ownership and cancellation during lazy initialization matter.

What validity means

Libphonenumber validity means the number matches numbering-plan metadata. It does not prove that the number is assigned, reachable, currently active, or controlled by a user. Use an actual verification flow before trusting ownership.

Metadata can change as numbering plans evolve, so results can differ after dependency updates. Region codes are ISO-style values such as US or GB; invalid region/input combinations fail parsing or validation according to libphonenumber.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.347 0 11/18/2026
11.0.346 12 11/18/2026
11.0.345 11 11/18/2026
11.0.344 155 11/11/2026
11.0.343 94 11/11/2026
11.0.342 101 11/11/2026
11.0.341 87 11/11/2026
11.0.340 89 11/11/2026
11.0.339 95 11/11/2026
11.0.338 104 11/11/2026
11.0.337 141 11/7/2026
11.0.336 199 11/3/2026
11.0.335 145 10/27/2026
11.0.334 108 10/27/2026
11.0.333 101 10/26/2026
11.0.332 99 10/26/2026
11.0.330 92 10/26/2026
11.0.329 92 10/26/2026
11.0.328 94 10/26/2026
4.0.327 102 10/26/2026
Loading failed

Updated NuGet packages