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

Re: Re: Re: regular expression (search and destroy)

by davido (Cardinal)
on Nov 13, 2003 at 00:14 UTC ( [id://306685]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: regular expression (search and destroy)
in thread regular expression (search and destroy)

I cannot enumerate all the difficulties associated with trying to parse a string where delimiters between quotes should be treated as text and not delimiters. But here are a few problems...

  • How do you provide for escaping delimiters aside from the quoting?
  • How do you provide for allowing quotes that are acting as text items rather than as quoting mechanisms?
  • How do you allow for nested levels of quote like characters?
  • Is ' the same as ", the same as `, the same as ....?

Those reasons and others make it much better to parse such entities using a "balanced text" module. And what sauok was telling you was that Text::Balanced is a "core" module, meaning, a module that if you have Perl, you have that module already, without waiting for a sysadmin to install it.

And what others have also suggested is that even if you can't use a CORE module (a module that comes with Perl, just like stdio.h comes with C), at very least you can use your web browser to view the source of a module, on the CPAN website. Then, you can have a look at what tools are used to accomplish your objective.

Otherwise, you're wasting your efforts and building a broken solution.


Dave


"If I had my life to live over again, I'd be a plumber." -- Albert Einstein
  • Comment on Re: Re: Re: regular expression (search and destroy)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-25 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found