Tag: regexp

  • Retrieving query string variables with JavaScript

    This is not something I use everyday. Seems more like a once a year thing. Last time I needed to extract query string variables, I used the old school approach with a regular expression. Now that I need to do this again, I can use the new school approach: URLSearchParams.

    The URLSearchParams (at the time of writing) is not yet standardized in the W3C; however, most modern browsers recognize it. I’ve also got a version of this for how-to Access query string parameters with Express and Node.js.

    (more…)

  • Regular Expressions with Mysql

    I must admit, this is something that I’ve never done until just recently; creating a regular expression in Mysql.  I’ve typically been able to accomplish whatever I wanted to with a LIKE statement or some server-side code.

    However, just recently I updated the plugin I use to output sample code.  I was previously using a syntax of [codesyntax lang=”php”] and now I needed to change it simply be [code].  This wasn’t that simple since I’ve done hundreds of blogs with several different languages.  In searching I had over 15 distinct differences – hence, regular expressions to the rescue!

    (more…)