Steven Levithan
Member since Dec 11, 2008
- Profile: /members/2107-steven-levithan.htm
- URL: http://stevenlevithan.com
- Comments: 172
Recent Blog Comments By Steven Levithan
-
The 5th Annual Regular Expression Day (And Prizes) - June 1st, 2012
Posted on Jun 4, 2012 at 12:18 PM
Make that 36. :) Jason Salvo, I played through it more than a dozen times, so the numbers I (and probably Ben Dalton) posted aren't entirely fair. Ben Nadel, some of the regexes are very well designed for this challenge. As Ben Dalton mentioned, the \b..\b style regexes, as well as some of those w... read more »
-
The 5th Annual Regular Expression Day (And Prizes) - June 1st, 2012
Posted on Jun 4, 2012 at 11:26 AM
Better fire it up again, @Ben Dalton. I just scored 34. ;-) And I'm a slow typist.... read more »
-
The 5th Annual Regular Expression Day (And Prizes) - June 1st, 2012
Posted on Jun 2, 2012 at 6:38 PM
Love the game, Ben. I've played through it a few times, scoring between 14 and 23. So hey, other players, at least you know a number to beat. :) With some additional features, I think this could actually be a great learning tool. If you ever end up spending more time on it, one thing that might be ... read more »
-
ColdFusion 10 - reEscape() vs. Java Pattern's Quote() Method
Posted on Mar 29, 2012 at 2:38 PM
Good to see that ColdFusion is still giving regular expressions at least a little attention. :) For the record, here's how you can do this in various other languages: * Perl: quotemeta(str) * PHP: preg_quote(str) * Python: re.escape(str) * Ruby: Regexp.escape(str) *... read more »
-
The Desire To Change Those We Care About
Posted on Jun 14, 2010 at 12:27 PM
@Ben Nadel, your friend Sabrina is most wise, and rather witty. :) My apologies in advance to her for stealing that quote.... read more »
-
Different Browsers Use Different Non-Matching Captured RegEx Pattern Values
Posted on Jun 14, 2010 at 10:24 AM
This is a Firefox bug in the handling of nonparticipating capturing groups. The following (old) post of mine lists additional related browser bugs and other info: http://blog.stevenlevithan.com/archives/npcg-javascript... read more »
-
Ask Ben: Javascript String Replace Method
Posted on Feb 21, 2010 at 12:20 PM
@Wize, the details of what you're trying to do are not clear to me. E.g., what's the deal with matching "rem" case insensitively (are you trying to harmonize the casing?) and do you only want to replace the first single quote (that is not enclosed in double quotes) on each line? Anyway, what you're... read more »
-
The Regular Expression Cookbook By Steven Levithan And Jan Goyvaerts
Posted on Jul 27, 2009 at 1:15 PM
Thanks, Ben (and Craig)! I've got to give props to coauthor Jan Goyvaerts though, who wrote a lot of the sections that you referenced.... read more »
-
Got My Sweet-Ass T-Shirts From Steven Levithan's Regular Expression Contest
Posted on Sep 13, 2008 at 7:48 PM
Coolness! Way to bring out the secret admirers. ;)... read more »
-
Partial Entry For Steve Levithan's Regular Expression Contest
Posted on Jun 13, 2008 at 10:48 AM
Nice. Wow, you put a lot of work into that... more than I was expecting from contestants. Parsing XML with regular expressions is something I've wanted to take a stab at for a long time since it sounds like a lot of fun (even though there are established implementations and possibly better approache... read more »
-
June 1st 2008 - National Regular Expression Day! (Post A Comment, Win A Prize)
Posted on May 29, 2008 at 5:17 PM
@Ben Doom, lolz. :) (Again, not a Perl hacker, but replacements are done with s/// [s stands for substitution].)... read more »
-
June 1st 2008 - National Regular Expression Day! (Post A Comment, Win A Prize)
Posted on May 29, 2008 at 4:38 PM
@Ben Doom, I'm not a Perl hacker, but I know that adding the "m" in `i =~ m/(^)(?:.*)($)/;` doesn't change anything. Some people have a preference to always use it, or not. @Eric, the parens and the bit about some adjustments being in the spirit of xkcd/208 threw me off, but "I am the alpha and the... read more »
-
June 1st 2008 - National Regular Expression Day! (Post A Comment, Win A Prize)
Posted on May 29, 2008 at 2:53 PM
@Eric, how do you read those? I'm sure I'm missing the joke.... read more »
-
June 1st 2008 - National Regular Expression Day! (Post A Comment, Win A Prize)
Posted on May 29, 2008 at 6:03 AM
@Jane, I haven't posted what prize I'm interested in, so I'm not in the running (intentionally).... read more »
-
June 1st 2008 - National Regular Expression Day! (Post A Comment, Win A Prize)
Posted on May 29, 2008 at 5:43 AM
Thanks for starting this, Ben. I've posted my own regex contest / giveaway at http://blog.stevenlevithan.com/archives/regexday-2008 . Of course, everyone here is welcome to participate there as well.... read more »
-
June 1st 2008 - National Regular Expression Day! (Post A Comment, Win A Prize)
Posted on May 28, 2008 at 2:15 PM
@Ben, yes. More specifically, it's what I call a capturing-group-participation-based conditional, which is a bit of a mouthful (and is not official terminology for any particular regex flavor). For the sake of deriving some kind of meaning, I suggest you read the regex as "If match 'me', match '[he... read more »
-
June 1st 2008 - National Regular Expression Day! (Post A Comment, Win A Prize)
Posted on May 28, 2008 at 1:26 PM
> post a comment below [...] on how > much you like regular expressions I will express my love in regex. (?i)(me)?(?(1)\u2665((?:reg(?:ular expressions?|ex(?:p|e[ns])?)))|(?!))(?>\1\2) @Eric, I've debugged that shirt, too. See: http://blog.stevenlevithan.com/archives/2b-or-not-2b :-)... read more »
-
REMatchGroup() UDF To Return Only Specified Group In RegEx Pattern
Posted on Jan 30, 2008 at 5:32 PM
It is derivative. A prime example is the very issue we're discussing. The latest versions of WebKit implement the correct ECMAScript handling for backreferences to non-participating groups (they always match), which is different from PCRE's native handling (they never match). I'm not trying to sugg... read more »
-
REMatchGroup() UDF To Return Only Specified Group In RegEx Pattern
Posted on Jan 30, 2008 at 4:33 PM
What is a PCRE-based engine? The only engine I can think of which that accurately describes is the one included in JavaScriptCore, the JavaScript engine for WebKit implementations such as the Safari browser. If you're using "PCRE-based" to describe popular Perl-derivative regex engines, I can tell y... read more »
-
REMatchGroup() UDF To Return Only Specified Group In RegEx Pattern
Posted on Jan 30, 2008 at 4:14 PM
And by the way, I would not recommend using stuff like /(?:foo) \1 (bar)/ even for illustrative purposes unless you know exactly what you're doing, because it's bound to cause confusion. The meaning varies between regex flavors and even specific implementations and versions of the same standards. Fo... read more »