Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Regex not matching all in DB

by graff (Chancellor)
on Jan 31, 2003 at 05:46 UTC ( #231528=note: print w/replies, xml ) Need Help??


in reply to Regex not matching all in DB

Well, I really don't think it has anything to do with your regexes; you say they are working on some cases, and since that is true, they should be working on all cases -- that is, all cases that really do match those regexes.

How closely have you looked at the content of the strings you get back from that database connection? I would suggest that there may be some extra characters in there that aren't visible if you're just using a typical console window or browser to view them. Open an output file -- and use binmode() to make sure nothing gets "interpreted" on output -- and write the offending text before and after the call to tagremover. Then look at it with any hex-mode viewer. It may be that some of those unaltered entities have "invisible" garbage characters thrown in somehow.

One other point, on a different topic:

while ($db->FetchRow()) { ... my $db2 = new Win32::ODBC($connstring) or die $!; ... }
I haven't used ODBC personally (I'm in a solaris/oracle shop), but it strikes me as wrong to be doing this connection thing on every iteration of the "while()" loop. Aren't you using the same database here as in the initial connection? Wouldn't the original connection be persistent and available for further queries/updates until you explicitly close it or exit? (I could be wrong about this, but if the repeated open is unnecessary, removing it could save you a lot of overhead.)

Good luck with the text content.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://231528]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2022-12-02 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?