eregi to preg


Posted on 16th Feb 2014 07:03 pm by admin

Im converting my regex for php 5.3 and I am stuck on the following

Code: [Select]if((eregi("<[^>]script*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*object*"?[^>]*>", $secvalue)) ||
Did you know?Explore Trending and Topic pages for more stories like this.
(eregi("<[^>]*iframe*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*applet*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*meta*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]style*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*form*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*img*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]*onmouseover*"?[^>]*>", $secvalue)) ||
(eregi("<[^>]body*"?[^>]*>", $secvalue) && !eregi("<[^>]tbody*"?[^>]*>", $secvalue)) ||
(eregi("([^>]*"?[^)]*)", $secvalue)) ||
(eregi(""", $secvalue)) ||
(eregi("forum_admin", $sec_key)) ||
(eregi("inside_mod", $sec_key))) {
block_ip($blocker_row);
}

anyone got any ideas on how to convert this to preg.so far I have this

Code: [Select]$html_regex = '{
^(
(?: <scriptb[^>]*>.*?</script> # script block
| <objectb[^>]*>.*?</object> # object block
| <iframeb[^>]*>.*?</iframe> # iframe block
| <appletb[^>]*>.*?</applet> # applet block
| <metab[^>]*>.*?</meta> # meta block
| <styleb[^>]*>.*?</style> # style block
| <formb[^>]*>.*?</form> # form block
| <imgb[^>]*>.*?</img> # img block
| <onmouseoverb[^>]*>.*?</onmouseover> # onmouseover block
| <bodyb[^>]*>.*?</body> # body block
)*+
)$
}isx';
if (preg_match($html_regex, $html_string))
No comments posted yet

Your Answer:

Login to answer
227 Like 48 Dislike
Previous forums Next forums
Other forums

data type in column definition
Hi,
I create a table with column called "Direction of Travel code ".
The travel codes in t

User feedback after MySQL query has been executed
Hi all, I've just registered on PHPFreaks because I've got a question that I simply can't work out b

* Gridview and Detailsview in UpdatePanel, insert mode problem
I have a GridView and DetailsView working together. When a record from Gridview is selected, Detail

dropdown box help - open php files to textarea
Hi, I am using tinymce to edit content located in several php files. The code I attached works but i

Generate multilayered array from string.
ok so i have a string that looks like this:
Code: [Select]blog:edit_all,delete_all|users:edit_all

PHP time (deadline within one week)
I have a column ['projdue'], which stores the deadline for a project.
I have PHP code and <

PHP Code / Script To check weather the given email exists in a domain
Hi,

I want to implement the following in my web page

in sign up we will ask to enter u

Problem Dereferencing
With these types and tables:

CREATE TYPE MANAGER AS OBJECT (
MGR_ID INTEGER,

Warning: mysql_num_rows() expects parameter 1
When i add quote at the end of this link
example:http://localhost/articlemania/category.php?cid=3

Warning: session_start() headers already sent error - Driving me Nuts!
I am trying my sister in laws site and I keep getting an error with my coding. I am more of a design

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash