R
Ramon F Herrera
This is really a parsing question, but I figure that nobody knows more
about regex and pattern matching than Perl programmers.
I have many files which contain multiple lines of variable-value pair
assignments. I need to break down each lines into its 3 constituent
components.
Variable Name = Variable Value
IOW, each line contains 3 parts:
VariableName
Equal Sign
VariableValue
As opposed to the variable names used by many programming languages,
my variable names accept embedded space.
Here's some examples of the lines I am trying to match:
My Favorite Baseball Player = George Herman "Babe" Ruth
What did your do on Christmas = I rested, computed the % mortgage and
visited my brother + sister.
Favorite Curse = That umpire is a #&*%!
What I need is a way to specify valid characters.
VariableName: Alphanumeric (and perhaps underscore), blank space.
VariableValue: Pretty much anything is valid on the RHS except an '='
sign (I guess)
Thanks for your kind assistance.
-Ramon
about regex and pattern matching than Perl programmers.
I have many files which contain multiple lines of variable-value pair
assignments. I need to break down each lines into its 3 constituent
components.
Variable Name = Variable Value
IOW, each line contains 3 parts:
VariableName
Equal Sign
VariableValue
As opposed to the variable names used by many programming languages,
my variable names accept embedded space.
Here's some examples of the lines I am trying to match:
My Favorite Baseball Player = George Herman "Babe" Ruth
What did your do on Christmas = I rested, computed the % mortgage and
visited my brother + sister.
Favorite Curse = That umpire is a #&*%!
What I need is a way to specify valid characters.
VariableName: Alphanumeric (and perhaps underscore), blank space.
VariableValue: Pretty much anything is valid on the RHS except an '='
sign (I guess)
Thanks for your kind assistance.
-Ramon