Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I read a post a few days ago about someone saying something like "shame on you for using regex like that". I just finally understand what regex is and that statement doesn't make much sense to me. Regex is like patterns and substitutions, are there specific times when you're not supposed to use them or there is something better to use?

Yeah, you hear this crap sometimes, especially when you are trying to parse HTML. Basically, there are modules to handle the parsing, and these modules (e.g. HTML::Parse) tend to be a very reliable and are a easy way to get the job done. HOWEVER, there is nothing wrong with using a regex. After all, Perl is optimized for regex. Many times using a regex will result in faster code than using a module. HOWEVER, most people do not fully understand regex, so they often overlook something. Basically, I love regex. Use them! Even for parsing HTML! Just make sure you know what you are doing! And have fun! But if your job is on the line, go ahead and use a module.


In reply to Re: A few random questions from Learning Perl 3 by Anonymous Monk
in thread A few random questions from Learning Perl 3 by sulfericacid

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?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-23 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found