Is there an Application to Create Regular Expressi

2019-04-30 19:22发布

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.

4条回答
够拽才男人
2楼-- · 2019-04-30 19:55

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

查看更多
We Are One
3楼-- · 2019-04-30 19:59

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.

查看更多
孤傲高冷的网名
4楼-- · 2019-04-30 20:09

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.

查看更多
地球回转人心会变
5楼-- · 2019-04-30 20:10

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

查看更多
登录 后发表回答