In: Statistics and Probability
Consider the following regular expression meta operators:
( ) [ ] { } . * + ? ^ $ | \
For each of the following, give one example of strings which the regular expression would match.
Describe (colloquially, in a manner that a non-technical person would understand) the set of strings that the pattern is designed to match.
Each regular expression is enclosed in the pair of '/' characters below.
[2 marks each]
(a) /^[a-z][0-9]*\.$/
(b) /([0-9]+)\s\w+\s\1/
ANSWER:
a.)
b.)
(OR) TRY THIS
a) Strings that start with a lower case alphabet followed by any number of optional digits
Example
d123
b) 1/more digits (number) followed by a space followed by 1/more alphabets or digits or underscores followed by a space followed by exact same number that it is starting with
Example
91509 abc 91509
NOTE:: I hope this answer is helpfull to you......**Please support me with your rating
**Please give me"LIKE".....Its very important for me......THANK YOU