Correct Answer: preg_match("/^ABC/i", $string)
Explanation:
Note: This Question is unanswered, help us to find answer for this one
Regular Expressions With PHP Test Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More Regular Expressions With PHP Test MCQ Questions
Which of the following characters is used to escape special characters in a given string during pattern matching using Regular Expressions?
Analyze the following code snippet that uses the preg_split() PHP Regular Expression method: < ?php $str = 'string'; $chars = preg_split('//', $str, -1, PREG_SPLIT_NO_EMPTY); print_r($chars); ?> What will be the output of the above code?
Which of the following characters can be used as a delimiter in a PHP Regular Expression?
Analyze the following code snippet that uses the preg_grep() PHP Regular Expression method: < ?php $names = array('Andrew','John','Peter','Nastin','Bill'); $output = preg_grep('/^[a-m]/i', $names); print_r( $output ); ?> What will be the output of the above code?
Which of the following PHP Regular Expression modifiers is used to put the Regex on multiple lines while at the same time allowing comments within the Regular Expression itself?
Analyze the following code snippet that uses the preg_split() PHP Regular Expression method: < ?php $keywords = preg_split('/[\s,]+/', 'php, regular expressions'); print_r( $keywords ); ?> What will be the output of the above code?
Analyze the following code that uses a PHP Regular Expression Character Set: < ?php $string = 'Welcome to the new era'; preg_match_all('/[h-b]/',$string,$matches); foreach($matches[0] as $value) {echo $value; } ?> What will be the output of the above code snippet?
Which of the following is the correct syntax for creating a Regular Expression object in PHP?
Which of the following PHP Regular Expression modifiers is used to find a pattern at the end of a string?
Analyze the following code that uses a PHP Regular Expression Character Set: < ?php $string = 'Is this all there is?'; echo(preg_match('/[^A-J]/',$string,$matches)); ?> What will be the output of the above code snippet?