We know that regular expression is just string pattern or simple string that describes the sequence of characters for searching something in the specified string. The test() method of any regular expression object returns the Boolean value that indicates whether or not the searched pattern exists in specified string. Continue reading Example: test() and exec() methods of the RegExp in JavaScipt
A twin prime is a prime number that differs from another prime number by two, for example the twin prime pair (41, 43) or (5,7). Simply means if N is the prime number and N+2 is also prime number then we can say that N and N+2 are the twin prime numbers.
Continue reading Find Twin Prime numbers between 1 and 1000 in C#
The following code snippet demonstrate how to use regx class to find out whether the specified string is found in a given text or not. From the given code you can search the string into string. Continue reading How to know whether a string is found in a text or not in C#
You can use the Regex.Replace method to replace one date format to another date format in the entire string. The following code example uses the Regex.Replace method to replace dates that have the form mm/dd/yy with dates that have the form dd-mm-yy. Continue reading Replace one date format to another date format in the entire string using Regular expression.
You can remove the set of the characters with the help of String.Remove method, but sometime this approach is not preferable by the developers, instead they use the regular expression for it. You can use the Regex.Replace method to strip some characters from the specified string. Continue reading How to remove invalid characters from a string using regular expression in c#
The following code example demonstrates how we can extract the all numbers from the specified text. Continue reading Find numbers from a text in c#
The Following example shows how to split single string into array of the strings with the help of Regular expression in .net. We can split an input string into an array of substrings at the positions defined by a regular expression match.
Following example show that how we can validate password with the help of Regular Expression that have following validation in vb.net and c# languages :
Continue reading Regular expression for password validation in .net
Following example show that how we can validate password with the help of Regular Expression that have these validation:
Must be at least 10 characters
Must contain at least one one lower case letter,
one upper case letter,
one digit and one special character
Valid special characters are – @#$%^&+=