Questions tagged [eregi]

PHP function for case insensitive regular expression matching

https://php.net/manual/en/function.eregi.php

Deprecated as of PHP 5.3.0 in favor of .
Removed as of PHP 7.0.0.

See also How can I convert ereg expressions to preg in PHP? on the required regex delimiters.

89 questions
22
votes
4 answers

ereg/eregi replacement for PHP 5.3

I'm sorry to ask a question but I am useless when it comes to understanding regex code. In a php module that I didn't write is the following function function isURL($url = NULL) { if($url==NULL) return false; $protocol =…
Colin
  • 231
  • 1
  • 2
  • 7
17
votes
3 answers

Deprecated: Function eregi() is deprecated in

I'm trying to submit values to the database but i get an error message Deprecated: Function eregi() is deprecated in C:\wamp\www\OB\admin_add_acc.php on line 20 and 27 Here is the code:
Jush
  • 193
  • 1
  • 3
  • 9
7
votes
1 answer

Alternative to eregi() in php

So, i was using eregi in my mail script, but as of lately, i get the error that the function is deprecated. So, what is the easiest way to replace the following bit of code: if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$",…
idjuradj
  • 1,355
  • 6
  • 19
  • 31
5
votes
3 answers

Function eregi() is deprecated

Function eregi() is deprecated. How can i replace eregi(). I try with preg_match but then stop working. i us ethis help: http://takien.com/513/how-to-fix-function-eregi-is-deprecated-in-php-5-3-0.php CODE BEFORE: if ( ! eregi("convert$",…
senzacionale
  • 20,448
  • 67
  • 204
  • 316
5
votes
3 answers

Deprecated: Function ereg() is deprecated

Possible Duplicate: How can I convert ereg expressions to preg in PHP? My contact form is othervise working but I keep getting the following error: Deprecated: Function ereg() is deprecated in/home/..... I'm really lost here but I figure this…
no0ne
  • 2,659
  • 8
  • 28
  • 44
4
votes
5 answers

Is it ok to use £ as delimiter in preg_replace?

I am converting an eregi_replace function I found to preg_replace, but the eregi string has about every character on the keyboard in it. So I tried to use £ as the delimiter.. and it is working currently, but I wonder if it might potentially cause…
Damon
  • 10,493
  • 16
  • 86
  • 144
4
votes
6 answers

PHP remove decimal from number string

i have an algorithym that gives back a number with a decimal point (I.E. ".57"). What I would like to do is just get the "57" without the decimal. I have used eregi_replace and str_replace and neither worked! $one = ".57"; $two = eregi_replace(".",…
DonJuma
  • 2,028
  • 13
  • 42
  • 70
3
votes
2 answers

PHP replace ereg(i)(_replace) globally

I have 150+ PHP files I need to change (updating ereg to preg_match). I tired to update them manually but it takes for ever and I want to make sure all my replace will work the first time. What can I do to do this kind of operation? Here's some…
Tech4Wilco
  • 6,740
  • 5
  • 46
  • 81
3
votes
3 answers

URL validation using eregi() but now with preg_match

eregi() is deprecated and need to replace with preg_match. How can I convert following syntax into preg_match? Suppose following are url and it's required regex pattern: $url = "https://james.wordpress.com/2013/05/13/my-product-final"; $urlregex =…
Jerry3456
  • 79
  • 7
2
votes
1 answer

question about eregi() and preg_match()

My code was if(eregi($pattern,$file)){ $out['file'][]=$file; }else But is doesn't work in php 5.3, it shows the alert Function eregi() is deprecated so I changed to if(preg_match($pattern,$file)){ $out['file'][]=$file; }else But now it shows…
Juni
  • 307
  • 2
  • 5
  • 10
2
votes
2 answers

Convert eregi function to php 5.3

Possible Duplicate: How can I convert ereg expressions to preg in PHP? How do i convert this code to php 5.3: if (eregi("VERIFIED",$this->ipn_response)) { }
Carlos Barbosa
  • 1,422
  • 2
  • 23
  • 42
2
votes
1 answer

How do I convert the following expression from POSIX to PCRE?

I wish there was a simple utility that would do this, as regular expressions scare me. I'd like to update the following to preg_replace() if anyone could explain to me how. eregi_replace('([a-zA-Z0-9_]{'.$min_char.','.$max_char.'})','',…
Chuck Le Butt
  • 47,570
  • 62
  • 203
  • 289
2
votes
3 answers

how can i solve " Deprecated: Function eregi() is deprecated" error

i am using php 5.3.0 and i am use wamp server function is like that eregi("^[ \f\r\t\n]{0,}(SELECT){1}(.+)$",$this->ss_last_query) eregi("^[ \f\r\t\n]{0,}(UPDATE|INSERT|DELETE){1}(.+)$",$this->ss_last_query)
user697932
  • 23
  • 2
  • 4
2
votes
1 answer

Replacing deprecated eregi() with stristr(). Is this php mail script secure from header injections?

I've been using the same php script to send emails from contact forms for years. But when my web server upgraded to php 5.3 the call to eregi was causing deprecated errors to display. After a Google search I learned that I could use stristr instead…
Evster
  • 2,552
  • 2
  • 16
  • 14
1
vote
2 answers

Deprecated: Function eregi_replace()

I am getting the following error when running on PHP 5.3.8 Deprecated: Function eregi_replace() is deprecated in /home/XXXXXX/public_html/admin/modifypoll.php on line 49 This is the line of code, can anyone help please $question =…
Garry
  • 135
  • 2
  • 13
1
2 3 4 5 6