Top "Preg-replace" questions

preg_replace() is a PHP function that performs string replacement using regular expressions.

PHP: strip the tags off the value inside array_values()

I want to strip the tags off the value inside array_values() before imploding with tabs. I tried with this …

php arrays preg-replace implode strip-tags
How can I extract all anchor tags, their hrefs and their anchor text within a string?

I need to process links within an html string in several different ways. $str = 'My long <a href="http://…

php regex preg-replace preg-match domdocument
php: converting from cp1251 to utf8

I have a problem converting a string from cp1251 to utf8... I need to get some names from database and …

php utf-8 preg-replace iconv cp1251
Detecting emails in a text

I'm trying to create a function that translates every occurrence of a plain text email address in a given string …

php regex email preg-replace preg-match
What is the "unit" of pcre.backtrack_limit?

I'm encountering an issue where preg_replace() with a complicated regular expression causes an error (PREG_BACKTRACK_LIMIT_ERROR) due …

php preg-replace backtracking
Java equivalent to PHP's preg_replace_callback

I'm in the process of moving an application from PHP to Java and there is heavy use of regular expressions …

java php regex preg-replace
Replace HTML entities with regular expression

I would like a regular expression in PHP to find all HTML entities such as "&lt;br /&gt; &…

php regex preg-replace
php regex to match outside of html tags

I am making a preg_replace on html page. My pattern is aimed to add surrounding tag to some words …

php regex preg-replace pcre
Remove BBCode tags and their content in PHP

Possible Duplicates: Recursive BBCode Parsing Strip BBCode via RegEx What is the best way to remove all BBCode tags of …

php regex preg-replace bbcode
Named backreferences with preg_replace

Pretty straightforward; I can't seem to find anything definitive regarding PHP's preg_replace() supporting named backreferences: // should match, replace, and …

php regex preg-replace backreference