Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Match one of 1, 2, x or X, or nothing

private Boolean patternIsMatch(String text) {
	// Alternatives; one of 1, 2, x or X, or nothing is accepted pattern.
	Regex pattern = new Regex(@"^([12xX]{1}|^)$");
	return pattern.IsMatch(text);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to write text in specific position in c# 
Csharp :: getelement video 
Csharp :: pubxml environment variables 
Csharp :: c# list keyvaluepair update value 
Csharp :: allow scroll with wheel mouse datagridview c# 
Csharp :: scene manager load scene 
Csharp :: how to find the text position in excel in c# 
Csharp :: c# json 
Csharp :: conncet oracle database in c# visual studio 
Csharp :: eventsource web api c# 
Csharp :: Startup.cs class is missing in .NET 6 
Csharp :: dynamic add event control c# 
Csharp :: how to check if an integer is in array c# 
Csharp :: c# how to delete all files in directory 
Csharp :: access label from another class c# 
Csharp :: structure in c sharp with example 
Csharp :: wpf keydown detect if control key is down 
Csharp :: unity sprite disappears when using transform.lookat 
Csharp :: C# checking if a value is a int 
Csharp :: 2d array rows and columns in c# 
Csharp :: asp.net call controller from another controller 
Csharp :: display none asp.net 
Csharp :: how to insert data into multiple tables using asp.net c# 
Csharp :: unity how to check index of enum 
Csharp :: except method c# 
Csharp :: messagebox yes no c# 
Csharp :: c# arrays 
Csharp :: array to object c# 
Csharp :: what dotnet command does 
Csharp :: logical operators in c# 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =