Writing parser right way in c#

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi All,
I need to parse certain text from a paragraph (like 20 lines).

I know the exact tags that I am looking for.

my approach is to define a xml (config) file that defines what tag I am
looking for and corresponding regular expression to search for the
pattern.

Xml file will also have a way to say what should be the pervious tag
and what should be the next tag. Again some of it through regular
expression and some of it through logic.

Run time just read the xml .find each tag and corresponding regular
expression execute it.

Assuming there may be more additions of the patterns and there might be
more rules coming up , Is this the best approach for this.

Are there other ways to make it more flexible and generic.

I don't want to end with stringent rules rather develop some sort of
extendable grammar.

Any Ideas
-KS

.



Relevant Pages

  • Re: Need a regex searching html code
    ... Regular expressions are simply not the right tool for the job. ... You have no possibility to determine which closing tag matches a given ... applied (not that familiar with how regexps actually work). ...
    (comp.lang.ruby)
  • Re: Need a regex searching html code
    ... This is one of many reasons it is a BAD idea to use regexes to parse ... Regular expressions are simply not the right tool for the job. ... You have no possibility to determine which closing tag matches a given ...
    (comp.lang.ruby)
  • Re: xtml: combining attributes from one element into a different element
    ... Thinking I could add the end tag like you do on a regular copy tag but ... But I am learning and see I probably need to use regular copy and then ... @* to grab all of the original attributes before trying to add the ... attributes in from the misc element. ...
    (comp.text.xml)
  • Re: How can I ensure that I always have a list?
    ... tdom is an XML parsing extension for Tcl. ... # Match one tag. ... # quotes, ... # key/value pair) for further processing the next time we go ...
    (comp.lang.tcl)
  • Re: How can I ensure that I always have a list?
    ... tdom is an XML parsing extension for Tcl. ... # Match one tag. ... # quotes, ... # key/value pair) for further processing the next time we go ...
    (comp.lang.tcl)