1. PHP has long supported two regular expression implementations known as _______ and _______.
1. Perl
2. PEAR
3. Pearl
4. POSIX
1. Perl
2. PEAR
3. Pearl
4. POSIX
2. Which one of the following regular expression matches any string containing zero or one p?
3. [:alpha:] can also be specified as.
4. How many functions does PHP offer for searching strings using POSIX style regular expression?
5. What will be the output of the following PHP code?
<?php
$username = "jasoN";
if (ereg("([^a-z])",$username))
echo "Username must be all lowercase!";
else
echo "Username is all lowercase!";
?>
<?php
$username = "jasoN";
if (ereg("([^a-z])",$username))
echo "Username must be all lowercase!";
else
echo "Username is all lowercase!";
?>
6. POSIX implementation was deprecated in which version of PHP?
7. POSIX stands for
8. What will be the output of the following PHP code?
<?php
$text = "this istsome text thatnwe might like to parse.";
print_r(split("[nt]",$text));
?>
<?php
$text = "this istsome text thatnwe might like to parse.";
print_r(split("[nt]",$text));
?>
9. Which of the following would be a potential match for the Perl-based regular expression /fo{2,4}/ ?
1. fol
2. fool
3. fooool
4. fooooool
1. fol
2. fool
3. fooool
4. fooooool
10. Which among the following is/are not a metacharacter?
1. /a
2. /A
3. /b
4. /B
1. /a
2. /A
3. /b
4. /B