Category: Regex

  • Useful regex resources

    Today I want to post a list of regex resources that have been useful for me. In the first time I haven’t read a regex book, I found all my knowledge on-line, and there is plenty of regex information out there. On-line resources, a great online resource on every aspect of regular expressions and […]

  • You do know Quantifiers. Really?

    Basics Everybody knows the Quantifiers + and *. Most will also know ?. But do you know that they are only shortcuts for convenience? No? The real quantifier in regular expressions is {m,n} where m is a number that defines the minimum amount to match and n is the number that defines the upper bound. The upper […]

  • Do you write readable regexes?

     Why not? Imagine you have a regex to validate a password ^(?=.*\p{Lu})(?=.*\P{L})\S{8,}$  Thats not too complicated, but the readability could be better. The solution here is the option x or IgnorePatternWhitespace. Most regular expression flavours allow you to use the option x, this is an important option everybody should know, who want to write longer patterns. […]

  • How to test your regular expression

    Of course, the ultimate tool is RegexBuddy by Jan Goyvaerts. I personally don’t have it at the moment, but I surely need to get it soon. It supports various languages, gives you detailed explanation on each part, you can step through the matching process … But if you use regex not often and do only small ones, […]

  • What absolutely every Programmer should know about regular expressions

    No, I am not going into theoretical definitions. I am going to talk about regex in todays computer languages and applications. I am surprised how many programmers think regexes are complicated and ask e.g. on Stackoverflow for a regex for a specific task. They will get most probably an answer, if they ask nicely. But […]