Top "Preg-replace" questions

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

regular expression and forward slash

i'm searching for keywords in a string via a regular expression. It works fine for all keywords, exept one which …

php regex preg-replace
Convert string into slug with single-hyphen delimiters only

I would like to sanitize a string in to a URL so this is what I basically need: Everything must …

php regex preg-replace slug sanitization
Symfony 1.4 using deprecated functions in php 5.5

I recently upgraded PHP from version 5.3.27 to 5.5.0. Everything is working fine in my Symfony 2.3.2 project, and I can enjoy the …

php preg-replace symfony-1.4 preg-replace-callback
What is the preg_replace regex to replace this HTML tag?

How would I convert strings like this: <span class="it">CONTENT</span> Into this: {it}CONTENT{/…

php regex html-parsing preg-replace
How to remove diacritics from text?

I am making a swedish website, and swedish letters are å, ä, and ö. I need to make a string entered by a …

php regex preg-replace diacritics
How to escape $ in PHP using preg_replace?

I am using preg_replace to escape special characters: $tmpStr=preg_replace("/\?/", "\?", $tmpStr); $tmpStr=preg_replace("/\#/", "\#", $tmpStr); $tmpStr=preg_replace("/\^/", "\^", $…

php regex preg-replace
How do I remove everything after a space in PHP?

I have a database that has names and I want to use PHP replace after the space on names, data …

php replace preg-replace
Simple preg_replace

I cant figure out preg_replace at all, it just looks chinese to me, anyway I just need to remove "&…

php string replace preg-replace
Using $ variables in preg_replace in PHP

Ummm... how do I use variables in a call to preg_replace? This didn't work: foreach($numarray as $num => $…

php variables preg-replace
Warning: preg_replace(): No ending delimiter '/' found

Warning: preg_replace(): No ending delimiter '/' found in C:\wamp\www\upload\upload_demo.php on line 77 I …

php preg-replace