Last comments for preg_replace()

On 16. Oct 2014 12:15 zxcat wrote:

array() in $pattern doesn't work here

On 24. Jun 2014 18:58 Florian wrote:

Nice tool, good job :) One small remark though. If you try to use backreference it wont work as you'd expect, here is the code generated for these values: $pattern => /the (dog|rat|duck) is ill/ $replacement => A \${1} is running $subject => the dog is ill preg_replace('/the (dog|rat|duck) is ill/', 'A \\${1} is running', 'the dog is ill', -1, $count); It fails because the $replacement (i.e 'A \\${1} is running') is set between simple quotes and not double quotes, also because of the backslash added.

On 16. May 2014 09:48 Mira wrote:

@butzi: Thank you. You are right. Works now perfect.

On 04. May 2014 17:00 butzi wrote:

@Mira: Please take a look at the manual. The $pattern ist required to be encapsulated in some special characters (mostly @ or / is used). Anyway else you get the error message.

On 04. May 2014 16:52 Mira wrote:

Great Tool But with: array('~([0-9]{4})_([0-9]{2})_([0-9]{2})__?([0-9]{2})_([0-9]{2})_([0-9]{2,3})(.*)~','~([0-9]{4})-([0-9]{2})-([0-9]{2}) ?([0-9]{2})[.]([0-9]{2})[.]([0-9]{2,3})(.*)~') I get ERROR: Delimiter must not be alphanumeric or backslash It comes from the {2,3} parts. About me this would be correct. Tested in real php. There no error happens. Mira

On 10. Oct 2013 10:10 Webmaster wrote:

Very clean and clear website and no advertisement, nice! And thanks for supporting HTML in expressions, well done!

On 05. Apr 2012 16:35 benjamin wrote:

hi, i have a escaped \ in my pattern: /(?

On 06. Jul 2010 11:35 niconoe wrote:

Ok, I thought like $limit was optional, you set it to -1 if NULL is post :) Happy to see that's fix for now, thanks for your great website!

On 06. Jul 2010 11:10 butzi wrote:

@niconoe: This function is working. You have to set the $limit Parameter to a proper value. As @oodavid mentioned $limit is now set to -1 by default, to avoid this problem.

On 05. Jul 2010 23:40 niconoe wrote:

don't work... I tried examples and it doesn't work... too bad :(