Redirected
recategorized
1,550 views

3 Answers

Best answer
2 votes
2 votes

option 4.

p+[3-5]*[xyz] = p+(3+4+5)*(x+y+z)
Since, p has to be present as the first character of each string, 
I. p443y -> matched
Il. p6y -> not matched since 6 cannot used .
III. 3xyz  -> not matched Strings must start with p.
IV. p35z  -> matched
V. p353535x  -> matched
Vl. ppp5 -> not matched Strings must end with x, or y, or z.

selected by
1 votes
1 votes
Ans (D) is right because

p+ [3 – 5]∗ [xyz]

means all string should start with p and end by x,y or z if this condition is not satisfied then rule out that options-

I. P443y = VALID

I. P6y = NOT VALID BCOZ 6 NOT PRESENT IN THE EXPRESSION

III.3xyz =NOT VALID BCOZ  NOT START WITH 'P'

IV. P35z = VALID

V. P353535X =VALID

VI. PPP5= NOT VALID BCOZ  STRING START WITH  'P' BUT NOT END WITH X,Y,OR Z
1 votes
1 votes
i think actual regular expression will be $P(3+4+5)^{*}(x+y+z)$

 So Option D will be true I, IV and V only
Answer:

Related questions

0 votes
0 votes
4 answers
2
go_editor asked Mar 24, 2020
1,049 views
Match the following :$\begin{array}{llll} & \textbf{List – I} & {} & \textbf{List – II} \\ \text{a.} & \text{Absurd} & \text{i.} & \text{Clearly impossible being con...
0 votes
0 votes
2 answers
4
go_editor asked Mar 24, 2020
930 views
How many multiples of $6$ are there between the following pairs of numbers?$0$ and $100$ and $-6$ and $34$$1$ and $6$$17$ and $6$$17$ and $7$$16$ and $7$