php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23219 Cannot use symbols as delimiters
Submitted: 2003-04-14 23:49 UTC Modified: 2003-04-23 03:20 UTC
From: lucphp at BrazilianTranslation dot net Assigned:
Status: Not a bug Package: *Regular Expressions
PHP Version: 4.3.1 OS: Windows 98 SE
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lucphp at BrazilianTranslation dot net
New email:
PHP Version: OS:

 

 [2003-04-14 23:49 UTC] lucphp at BrazilianTranslation dot net
I have some scripts that use a lot of preg_match and preg_replace. And I use the ? symbol as a delimiter because
I never used that symbol for anything else in my life, so I never have to worry about escaping it. I would be escaping (and missing) a lot of occurrences if I had been using / or | . I have used these scripts for many months, almost a year. I didn't use them in about a month, maybe a little
more, and I don't remember updating/upgrading PHP during that period. But my mind could be deceiving me. Maybe the last time I used them was before I updated PHP to v. 4.3.1. At least I am 100% sure the scripts and my INI file have not been changed. They should be working.

Now I try to run my old scripts and, in some of them, PHP gives me some attitude:
Warning: Delimiter must not be alphanumeric or backslash in
C:\WINDOWS\Desktop\conversor-folha.php on line 25
Some scripts work, others don't. What can I do to pinpoint the problem?

------------------------ 8< ------------------------
$pattern = '?(Foi encontrado|Foram encontrados) *<b>[0-9]+</b>
*an?ncios?.*Clique nos &iacute;cones para adicionar os an&uacute;ncios
&agrave; &quot;?s';

$po = preg_match ($pattern, $x, $matches);
------------------------ >8 ------------------------

Thanks,
Luciano ES
Santos, SP - Brasil

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-23 03:20 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 18:01:28 2024 UTC