PHP Programming Basics Practice Test: Strings And Regular Expression in PHP — Flashcards | PHP & Programming | FatSkills

PHP Programming Basics Practice Test: Strings And Regular Expression in PHP — Flashcards

Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.

In PHP, regular expressions are strings that contain delimiters, a pattern, and optional modifiers.

For example, /fatskills/i is a regular expression that contains the delimiter /, the pattern fatskills, and the modifier i, which makes the search case-insensitive.
 

Here are some things to keep in mind about regular expressions in PHP:
The delimiter can be any character that is not a letter, number, backslash, or space. The forward slash (/) is the most common delimiter, but you can use other delimiters like # or ~ when your pattern contains forward slashes.
The expression is contained within two characters, followed by optional flags. For example, in the expression /foo|bar)/i, (foo|bar) is the expression and i is a flag.
You can use anchors to match at the beginning or end of a line, word, or string. Two common anchors are caret ( ^ ) which represent the start of the string, and the dollar ( $ ) sign which represent the end of the string. 

1 of 18 Ready
PHP has long supported two regular expression implementations known as _______ and _______
i) Perl
ii) PEAR
iii) Pearl
iv) POSIX
i) and iv)
Shortcuts
Prev Space Show / hide Next
Turn this into a study set.
Sign in with Google to save tricky questions to your reminder list and resume on any device.
Sign in with Google Free • no extra password