Extracting Name Value Pairs



Hi I have a long line of text that I want to parse for name/value pairs
see example below
( note:
- it is a one long line so please remove linebreaks, and
- I have replaced tabs with the pipe for clarity)

I am trying to regex to extract the name/value pairs; perhaps I could just
use a split function (this just occured to me as I pasted the example below.

Nevertheless, can i use RegEx to extract name value pairs?
the pattern i am came up with (whch I bet could be improved) is
Patrn1 = ""
Patrn1 = Patrn1 & "\t*([\w]+)\t([\w \/\x22]+)\t*" ' first value pair
Patrn1 = Patrn1 & "\{\t*(Alignment)\t([\w \x22]+)" 'second value pair to
account for the bracket; I suppose I could replace it with nothing
Patrn1 = Patrn1 & "(\t*([\w]+)\t([\w \x22]+))+" 'third value pair, which
should repeat but does not...

thanks in advance for your assistance.
Regards
Habib



------------------------------
||||ReportCalculatedField|"328"||||||||{|||||Alignment|"right"|||||BackColor|"Transparent"|||||CalculatedField|"Apply
Bucket
1"|||||DisplayOptions|"HideWhenEmpty"|||||DisplayType|"Data"|||||Font|"Helvetica
(generic)"|||||FontBold|"false"|||||FontColor|"Black"|||||FontItalic|"false"|||||FontSize|"7"|||||FontUnderline|"false"|||||Format|""|||||FormatField|"'Func/Rept
Index'"|||||Pattern|"(none)"|||||PatternColor|"White"|||||PositionLeft|"365"|||||PositionTop|"256"|||||ReadingOrder|"LeftToRight"|||||SizeHeight|"8"|||||SizeWidth|"72"|||||ZOrder|"116"||||}

------------------------------

--
www.DynExtra.com
A resource for the Microsoft Dynamics Community
Featuring FAQs, File Exchange and more
Current member count: 21

--------------------------------------------

Share your knowledge. Add your favorite questions and answers


Help add questions to this site! We want Your input.



.



Relevant Pages

  • Re: Regex searches including spaces
    ... On Thursday 23 Oct 2003 1:03 am, Paul Harwood wrote: ... > I am trying to parse through the following line: ... > I want to extract the 1828 value. ... is there a Regex generator of some kind ...
    (perl.beginners)
  • regex needed
    ... Can someone please give me a regex to parse the following... ... I need to use the rule number in another command to delete the route entry... ... So I presume I'll need to extract it via the regex ...
    (perl.beginners)
  • RE: Extract the desired value from a regex
    ... Extract the desired value from a regex ... property of Persistent Systems Ltd. ... Systems Ltd. does not accept any liability for virus infected mails. ...
    (perl.beginners)
  • Parsing and regex
    ... I am writing a program to parse a Cisco ASA log file. ... I have created a database that contains the 6 ... digit rule number which is unique, a severity level, the full ASA rule ... regex "rule" in the database. ...
    (comp.lang.perl.misc)
  • Re: Speed of using OLE for automation
    ... This functions extract all the ... Additionally, style, font size, page and line number is extracted. ... The challenge is that I need to parse large documents with my ... works closely with the Word object model into VBA procedures. ...
    (microsoft.public.office.developer.automation)