#50232 [Csd]: preg_replace - pattern description omits mention of string delimiter

From: Date: Tue, 12 Jan 2010 02:58:23 +0000
Subject: #50232 [Csd]: preg_replace - pattern description omits mention of string delimiter
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3677@lists.php.net to get a copy of this message
ID: 50232 User updated by: simonokewode at hotmail dot com Reported By: simonokewode at hotmail dot com Status: Closed Bug Type: Documentation problem Operating System: n/a PHP Version: Irrelevant New Comment: Thanks for improving the documentation of delimiters - it's a good overview description. It's too bad the original problem, no mention of the existence of delimiters in the function pattern description, was determined to be unworthy of addressing even by a word or two. Previous Comments: ------------------------------------------------------------------------ [2009-12-19 21:11:22] degeberg@php.net This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. I've added an additional section that elaborates on the delimiters. ------------------------------------------------------------------------ [2009-12-19 21:10:23] svn@php.net Automatic comment from SVN on behalf of degeberg Revision: http://svn.php.net/viewvc/?view=revision&revision=292344 Log: Closes #50232. ------------------------------------------------------------------------ [2009-12-03 06:43:16] traveltechrcs at yahoo dot com I am new to php and found this issue after and install of an opensource search script install. I did many searches and this is one of the resources I found. The other resources provided no clear cut resolutions as examples for using preg_replace syntax with delimiters. I also found that many support folks are directing their users to include a line of code to simply turn of the error reporting. I'm not sure what kind of problems this will cause down the road but it doesn't seem like a good idea to me. Other resources are directing users to use the mb_eregi_replace as a solution. As a noobie as put in your comments I think we could use a clear, real life example and direction as far as error reporting and the use of mb_eregi_replace. Here is a line of my code that was converted to use mb_eregi_replace. $a = mb_eregi_replace($char[0], $char[1], $a); It would help to see an example of a conversion from that to preg_replace. Thanks Tsalagi ------------------------------------------------------------------------ [2009-11-24 20:38:47] simonokewode at hotmail dot com Well that's good to know. So someone needing to move from ereg_replace to this function is expected to know that they should read the "Regular Expressions (Perl-Compatible)" description first? A note to that effect would help the many people who will be coming straight here for a single purpose. If PHP is eliminating a function, I think it is right to make it straightforward to convert. ------------------------------------------------------------------------ [2009-11-24 19:48:01] daniel dot egeberg at gmail dot com It already says that delimiters are needed around the pattern here: http://php.net/manual/en/intro.pcre.php ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/50232 -- Edit this bug report at http://bugs.php.net/?id=50232&edit=1

« previous php.doc.bugs (#3677) next »