PHP TutorialLesson 24Free preview
PHP RegEx Functions
This lesson is part of PHP · All levels
Summary
PHP provides a set of preg_* functions to use regex, such as preg_match, preg_match_all, preg_replace, and preg_split. This lesson explains the differences between these functions and examples of their use. It's important to remember that regex functions require boundary-packed patterns like slash.
Key points
- Looking for the first match, taking all the matches.
- Preg_replace() change the text based on regex pattern
- Break the string according to a certain pattern
- Regex pattern wrapped in a borderline like a pattern.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.