ereg() warning: REG_EBRACK

Discussion on PHP Scripting
no avatar
Posts: 3
Joined: Wed Aug 08, 2007 1:53 pm

ereg() warning: REG_EBRACK

by christina_rules » Wed Aug 15, 2007 2:11 pm


i've been getting this warning when i run my php script. what is this?

i'm trying to do a search engine, and i'm scanning through the html file. my warning is for this line

--> if (ereg("<meta\s*name=keywords\s*content=.*\s*[/\s*>|></meta>|>", $line))

but i'm getting warning: doesn't state anything else? can anyone tell me what is my problem?

no avatar
Site Admin
Posts: 144
Joined: Fri Apr 27, 2007 6:52 pm

by tutorialspoint » Fri Aug 24, 2007 5:32 pm

Please use blackslash before opening square bracket becuase this is reserved to specifiy multiple search options....

So try the following and it won't give warning..

if (ereg("<meta\s*name=keywords\s*content=.*\s*\[/\s*>|></meta>|>", $line))

Moderator, TP
Keep visiting and share this site with your friends.

no avatar
Posts: 1
Joined: Wed Apr 07, 2010 7:35 am


by cricketer » Wed Apr 07, 2010 7:40 am

I also have the same problem :

NoMethodError in Book#new

Showing app/views/book/new.rhtml where line #4 raised:

undefined method `title' for #<Book id: nil, created_at: nil, updated_at: nil>
Extracted source (around line #4):

1: <h1>Add new book</h1>
2: <%= form_tag :action => 'create' %>
3: <p><label for="book_title">Title</label>:
4: <%= text_field 'book', 'title' %></p>
5: <p><label for="book_price">Price</label>:
6: <%= text_field 'book', 'price' %></p>
7: <p><label for="book_subject">Subject</label>:

annoying isn't it?! MIGHT IT BE A VERSION PROBLEM???
sunglasses and jewelry for all ages of women furniture

Return to PHP Script