Is there an Application to Create Regular Expression Out of Text by Selecting Wanted Area?

StackOverflow https://stackoverflow.com/questions/122402

  •  02-07-2019
  •  | 
  •  

Question

I hope this is programmer-related question. I'm in the hobby business of C# programming. For my own purposes I need to parse html files and the best idea is..regular expression. As many found out, it's quite time consuming to learn them and thus I'm quite interested if you know about some application that would be able to take input (piece of any code), understand what i need (by Me selecting a piece of the code I need to "cut out"), and give me the proper regular expression for it or more options.

As I've heard, Regex is a little science of itself, so it might not be as easy as I'd imagine.

Was it helpful?

Solution

Yes there is Roy Osherove wrote exactly what you're looking for - regulazy

OTHER TIPS

Not real answer to your question, as it has nothing to do with regex, but HtmlAgilityPack may help you with your parsing.

You might also want to try txt2re : http://txt2re.com/, which tries to identify patterns in a user-supplied string and allows to build a regex out of them.

I gotta agree with Sunny on this one: if you're parsing html, you're better off converting it to XML (using the HTML Agility pack it's trivially easy) and then you can using XPATH expressions rather than regular expressions, it's far better suited to the job.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top