开发者

list of regular expressions

I'm looking for a concise list of all the regular 开发者_StackOverflowexpression syntax (sort of like a cheatsheet) and I found this tool: http://erik.eae.net/playground/regexp/regexp.html

in which if you click on the question mark on the top right corner it will display some sort of dictionary of regular expressions...

my question is....is this list comprehensive or is it missing something?

if anyone knows a better list, please let me know as well


Regex syntax varies between different implementations. Therefore, there is unlikely to be an absolutely definitive syntax list which covers everything. You may get one which covers all possible options for regex in a given language, but you'd need a different reference for regex implementations in other languages.

For example, some regex implementations allow named classes such as [:space:] or [:digit:], which don't exist in others.

My favourite reference site for regular expressions is http://www.regular-expressions.info, which does include details of differences in regex between various languages, but I'll be the first to acknowledge that it doesn't cover everything.


regular-expressions.info is a quite good reference for regular expression. They also have a comparison of syntax components available in the various regular expression flavors.


How could it be comprehensive? There are many, many, more or less obscure regular expression engines out there, each with its own syntax. The ? isn't even the entire Java Pattern syntax, to name one.


There are a number of different dialects - for example, you could write \s or [:space:] to match whitespace, but the mentioned source covers all principal constructs, and more importantly, is sufficient to create all regular expressions.


Most of the things are there, but I suggest you go here: http://regular-expressions.mobi/quickstart.html. In this page every single element is explained.

Good luck!


http://rubular.com/ has a short cheat sheet at the bottom of the page and the great thing about that site is that you can try out the expression you are forming along with some example text to parse. This has found lots of errors in my code and allowed my to sandbox RegEx really quickly.

If the site does not respond inside 30s you may have a very poor network connection or more likely your RegRx is very inefficient or just plane invalid... I may have done that a few times.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜