For this question feel free to use POSIX standard syntax Of
For this question, feel free to use POSIX standard syntax. Of particular use may be bracket expressions (e.g. [0-9] matches any digit from 0 through 90 and the POSIX extended metacharacter \'+\' which matches the preceding element one or more times (as opposed to the Kleene star, which matches zero or more times). Of course, the Kleene star (*) and alternation (|) metacharacters are allowed. Write the regular expressions for the following. The set that includes the four keywords int, while, for, and case. The set of floating point numbers of the form X \'.\'Y\'e\' z where X, Y, and Z are simple sequences of digits and \'e\' is the letter e. For example, 1.0002e12 is one such number. The lowercase letter \'a\' or \'b\'.
Solution
a) [[:name:]] this matches the word \"name\". So, if we a pattern to match any of these keywords int,for,while,case:
expression: [[:int:][:for:][:while:][:case:]]
b) Since X,Y,Z represents sequence of numbers they are represented by[0-9]*
c) Since we can use all the uppercase and lower case letters for start, [[:alpha:]]
and end would be either with a or b
So answer would be [[:alpha]][ab]
![For this question, feel free to use POSIX standard syntax. Of particular use may be bracket expressions (e.g. [0-9] matches any digit from 0 through 90 and the For this question, feel free to use POSIX standard syntax. Of particular use may be bracket expressions (e.g. [0-9] matches any digit from 0 through 90 and the](/WebImages/35/for-this-question-feel-free-to-use-posix-standard-syntax-of-1104637-1761584387-0.webp)