Advertisements

ereg() warning: REG_EBRACK

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

Offline
christina_rules
Posts: 3
Joined: Wed Aug 08, 2007 1:53 pm
hello,

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: REG_EBRACK..it doesn't state anything else? can anyone tell me what is my problem?
christina_rules

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

Offline
tutorialspoint
Site Admin
Posts: 143
Joined: Fri Apr 27, 2007 6:52 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))


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

ยป

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

Offline
cricketer
Posts: 1
Joined: Wed Apr 07, 2010 7:35 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