Vidyalelo
PHP · Q10

Regular Expressions

Programming · PHP · question 10

Q10

Which among the following is/are not a metacharacter? 1. /a 2. /A 3. /b 4. /B

A.
Only 1
Answer
B.
1 and 3
C.
2, 3 and 4
D.
2 and 4

Answer: Option A

Solution

Answer: Option A
Solution:
/A, /b and /B are metacharacters. A: Matches only at the beginning of the string. b: Matches a word boundary. B: Matches anything but a word boundary.