Top "Preg-replace" questions

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

Replace only first match using preg_replace

I have a string with structure similar to: 'aba aaa cba sbd dga gad aaa cbz'. The string can be …

php regex preg-replace
PHP using preg_replace : "Delimiter must not be alphanumeric or backslash" error

I am trying to take a string of text like so: $string = "This (1) is (2) my (3) example (4) text"; In every instance …

php regex preg-replace
How do I remove http, https and slash from user input in php

Example user input http://domain.com/ http://domain.com/topic/ http://domain.com/topic/cars/ http://www.domain.com/topic/…

php function preg-replace
Remove double quote in json_encode()

I want remove double quote in my json_encode, that is my code: <?php require_once 'config.inc.php'; //## …

php preg-replace json double-quotes
Is there a MySQL equivalent of PHP's preg_replace?

I have a to match a field in MySQL, for which I thought I could use a regular expression, but …

php mysql regex replace preg-replace
JavaScript equivalent for PHP preg_replace

I've been looking for a js-equivalent for the PHP preg_replace function and what I found so far is simply …

php javascript regex preg-replace
PHP preg_replace/preg_match vs PHP str_replace

Can anyone give me a quick summary of the differences please? To my mind they both do the same thing? …

php preg-replace preg-match str-replace
PHP remove line break or CR LF with no success

I did a function to remove line break with php with no success, i tryed all replace code and i …

php preg-replace line-breaks
Warning: preg_replace(): Unknown modifier ']'

I have the following error: Warning: preg_replace(): Unknown modifier ']' in xxx.php on line 38 This is the …

php regex wordpress preg-replace
Regex to only allow alphanumeric, comma, hyphen, underscore and semicolon

I've already got a bit of working code but I need someone to help explain why it works if they …

php regex preg-replace