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... Show more 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. Show less
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.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.