Top "Preg-match-all" questions

A PHP function that performs a global regular expression match using PCRE patterns.

"Unknown modifier 'g' in..." when using preg_match in PHP?

This is the regex I'm trying to use: /^(\w|\.|-)+?@(\w|-)+?\.\w{2,4}($|\.\w{2,4})$/gim I found it on this …

php regex preg-match preg-match-all
php to extract a string from double quote

I have a string: This is a text, "Your Balance left $0.10", End 0 How can I extract the string in between …

php string preg-match preg-match-all double-quotes
PHP preg_match and preg_match_all functions

I would like to know what the preg_match and preg_match_all functions do and how to use them.

php preg-match preg-match-all
Getting the first image in string with php

I'm trying to get the first image from each of my posts. This code below works great if I only …

php image preg-match-all
Regex - Ignore some parts of string in match

Here's my string: address='St Marks Church',notes='The North East\'s premier...' The regex I'm using to grab …

regex preg-match-all
PHP/REGEX: Get a string within parentheses

This is a really simple problem, but I couldn't find a solution anywhere. I'm try to use preg_match or …

php regex preg-match preg-match-all
Regex that extracts text between tags, but not the tags

I want to write a regex which extract the content that is between two tags <title> in a …

php regex preg-match preg-match-all
Get all matches from string that start with and end, using php

How would I use PHP to extract everything in between [startstring] and [endstring] from this string: [startstring]hello = guys[endstring] …

php regex preg-match preg-match-all
Find whole line that contains word with php regular expressions

I want to search for a word "session" in a text. But I would like to retrieve the whole line …

php regex line preg-match-all