Jump to content

[SOLVED] ereg() help, REG_BADBR


Recommended Posts

I'm getting this error in my ereg()

Warning: ereg() [function.ereg]: REG_BADBR in populate.php on line 10

 

Line 10

if (ereg("^[:punct:]{1}[:alnum:][:punct:]{1,4}[:alnum:][:punct:]{1,4}[:alpha:](.*)$",$currentDKP[$linenum],$regs)){

 

what i'm trying to read.

"Hanover Street (Special Edition)","Columbia/Tri-Star",,"Out","4.0","LBX, 16:9",9.95,"PG","1979","Drama","2.35:1","043396058316",2001-07-31 00:00:00,11881,2006-02-14 00:00:00
"Marathon Man","Paramount",,"Out","5.1","LBX, 16:9",9.99,"R","1976","Mystery/Suspense","1.85:1","097360878943",2001-08-28 00:00:00,12354,2006-08-11 00:00:00

 

I have a txt file with 127,000 of those i'm trying to get into a mysql database

from what i have read and searched on I think it is a repetition error but I don't know where

Its all comma seperated values

 

Link to comment
https://forums.phpfreaks.com/topic/71044-solved-ereg-help-reg_badbr/
Share on other sites

So wasted a large amount of time trying to get pear installed on my development server and because I was not paying attention durring install had a few wrong directory's and had to reinstall my server (no big deal its a development server for a reason)

 

If you mean changing the double quotes in my text file i'd rather not since there is 127,000 (One Hundred Twenty Seven THOUSAND, the text file is 20mb!) entrys...

 

I don't see how escaping the $ will help

 

as for now I'm off to reread some regex tutorials to see if i can rewrite my search.

have made some progress but not quite getting the responce I'm looking for

if (ereg("(^[[:punct:]]{1})(.+)([[:punct:]]{3,4})",$currentDKP[$linenum],$regs)){

 

if i echo $regs[2] i get the first part of what i want but the problem is the rest of the junk that I dont which would start at ","

 

heres an example

10 Things I Hate About You","Buena Vista",,"Out","5.1","LBX",14.99,"PG-13","1999","Comedy","1.85:1

 

is there a way i can tell it to get digits,text and spaces till "," with all my looking around and reading I have done nothing but made my head hurt alot and get tired.  Not to mention I also tried to figure out the one in your sig effigy

 

I'm going to pick this back up in the morning, Night

Change your double quotes to single

 

I've actually split the file into a smaller test file and replaced all the "," with ; which is not found in the file anywhere.

 

heres what it looks like now

"10 Things I Hate About You;Buena Vista;Out;5.1;LBX",14.99,"PG-13;1999;Comedy;1.85:1;717951004208",1999-10-12 00:00:00,3,2005-12-17 00:00:00

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.