php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17632 ereg doesn't work correctly with (
Submitted: 2002-06-06 15:43 UTC Modified: 2002-06-06 20:19 UTC
From: jesse at erieonline dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.2.1 OS: Freebsd 4.5
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jesse at erieonline dot com
New email:
PHP Version: OS:

 

 [2002-06-06 15:43 UTC] jesse at erieonline dot com
After doing work using the ereg function, I've discovered that the function doesn't care for '('.  Everytime it is used, php will produce a warning message.  If I remove the '(', the function will work, but as soon as I add it back in, the warnings reapper.

if (ereg("> (", $line)) { 

Warning: REG_EPAREN in /usr/home/grimreapa.com/public_html/emailparse.php on line 5

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-06 15:49 UTC] mfischer@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. 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

Thank you for your interest in PHP.

How about escaping it with '\' ?
 [2002-06-06 16:15 UTC] jesse at erieonline dot com
Using the '\(' didn't work either, but I worked around the problem using a different method.
 [2002-06-06 20:19 UTC] torben@php.net
Please read the docs on escapes in strings, and on regular
expression syntax--it'll explain why your code didn't work.

  http://www.php.net/manual/en/language.types.string.php
  http://www.php.net/manual/en/ref.regex.php


Hope this helps,

Torben
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 29 16:01:30 2024 UTC