Snippets tagged regex

  • Functional style Regex engine

    Functional style Regex engine

    21 people like this

    Posted: 11 years ago by Nick Palladinos

  • URL Canonicalization

    This function produces safe URLs for Web requests or URI construction. It forces the pattern: http:// + www. OR subdomain. + domain + absolute path. When used in an application that takes URLs as input, the user would be able to type "" instead of "" or "". It also supports domains like or

    8 people like this

    Posted: 11 years ago by Taha Hachana

  • Perl Style "Regex Matches?" operator

    Perl Style "Regex Matches?" operator

    49 people like this

    Posted: 11 years ago by fholm

  • Count noise-lines in C# code

    This is the code I used to generate this pie chart: Enough said?

    9 people like this

    Posted: 9 years ago by Kit Eason

  • cron scheduling

    Parsing cron expression and calculating next launch time from schedule. v 1.1: bugs fixed for case */n + catch bad parsings

    4 people like this

    Posted: 7 years ago by dvitel

  • Regex Applicative Functor

    Give a way to apply captures values on a given function

    1 people like this

    Posted: 6 years ago by cboudereau

  • Test string is all UpperCase 2

    There is another "All Uppercase" snippet that does two searches - one to verify that there's at least one upper case letter and one to make sure there are no lowercase letters. "---D" is "uppercase" but "---" is not. I wanted to duplicate that behavior even though it seems a bit questionable, but do it in one regex search. The underappreciated lookahead features of RegEx allow this sort of thing - scanning forward and then rescanning forward so I use that here

    1 people like this

    Posted: 4 years ago by Darrell Plank

  • Web Crawler

    This snippet features an F# Web crawler that i'm already using in 2 applications (slightly modified). It's based on a scalable network of communicating agents that follow URLs extracted from HTML pages until reaching the specified limit.

    4 people like this

    Posted: 1 year ago by Taha Hachana