The most basic expression consists of an operator,two operands and an assignment.
The following is an example of an expression:
int result = 3 + 2;
where + is Operator and
3,2 are Operands
Expressions in C# can use operators that in turn use other expressions such as parameters or method calls. The parameters that are used in turn uses other method calls. So,expressions can range from elementary to very complex.
Following are two examples of expressions:
1.((x 4)) || ((x > 25) && (x < 30))
A regular expression, is a special text string for describing a search pattern. Fundamentally, a regular expression is a pattern describing a certain amount of text. Their name comes from the mathematical theory on which they are founded. The regular expression is abbreviated to regex or regexp. Regex is the most commonly preferred abbreviation, because it is easy to pronounce the plural “regexes”. They clearly distinguish the pattern from the surrounding text and punctuation.
Categories to define Regular Expression
The example provided below shows a simple program.
public static void Main(string args)
Regex regex = new Regex(@"\d+");
Match reg = regex.Match("SPLessons-3 Chapter Regular Expression");