Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Re: Regex not matching all in DB by graff
in thread Regex not matching all in DB by Willman023

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2022-12-04 05:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?