[tpm] I wish I was better at regex's
Uri Guttman
uri at StemSystems.com
Wed Mar 9 13:43:16 PST 2011
>>>>> "JBL" == J Bobby Lopez <jbl at jbldata.com> writes:
JBL> Agreed, but in the event that you don't have a strict format for
JBL> comments and key/value pairs (quotes/no quotes; comments with
JBL> special characters/without), then you're still looking for the
JBL> last instance of ';' outside of last (possible) quote, no?
if you DON'T have a strict format, how can it be parsed and used by any
program? you have to assume or know the rules. this is a config file
that is already being parsed and used by some program. the OP wants to
modify it with perl regexes which is the wrong solution. since it has a
specification of some sort, it can be parsed and left to right parsing
is the way to go.
uri
--
Uri Guttman ------ uri at stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
More information about the toronto-pm
mailing list