Skip to main content

Timeline for Regex - Match half of the strings

Current License: CC BY-SA 3.0

18 events
when toggle format what by license comment
Feb 20, 2014 at 15:32 vote accept Cruncher
Jan 16, 2014 at 21:21 answer added Justin timeline score: 5
Jan 16, 2014 at 21:18 answer added xem timeline score: 11
Jan 16, 2014 at 21:15 comment added Kendall Frey @JanDvorak Please don't say that \W matches uppercase letters.
Jan 16, 2014 at 21:08 comment added Tim Seguine @JanDvorak I know, that is exactly my point. You are matching too many one character strings. There are 62, and you match 57 of them. It does it that way in PCRE at least IIRC. Is there a dialect in which it doesn't? If there is, then I concede defeat.
Jan 16, 2014 at 21:05 comment added John Dvorak @TimSeguine I mean, if \w matches both lowercase and uppercase
Jan 16, 2014 at 21:05 answer added xem timeline score: 2
Jan 16, 2014 at 21:04 comment added Tim Seguine @JanDvorak The problem doesn't say anything about case insensitivity
Jan 16, 2014 at 21:02 comment added John Dvorak @TimSeguine if it's case insensitive, then A-Z it is.
Jan 16, 2014 at 21:02 comment added Tim Seguine @JanDvorak but doesn't \w match all word characters?
Jan 16, 2014 at 21:01 answer added Tim Seguine timeline score: 5
Jan 16, 2014 at 21:01 comment added John Dvorak @Cruncher the same as above. If it starts with lowercase or a low digit, match. Otherwise, don't.
Jan 16, 2014 at 21:00 comment added Cruncher @JanDvorak I don't see how. Can you explain?
Jan 16, 2014 at 20:56 comment added Tim Seguine oh yeah sorry, it works for one character but gets worse and worse after that. If i remove the star and the $ though, it should work. It takes then half of all one character strings and all of the other strings that start with one of those characters.
Jan 16, 2014 at 20:56 comment added John Dvorak /^[\w0-4]/ works, doesn't it?
Jan 16, 2014 at 20:55 comment added Cruncher @TimSeguine No, if strings could have only uppercase, or only lower case it would. But since most strings have a combination of both, that misses most strings
Jan 16, 2014 at 20:53 comment added Tim Seguine /^[A-Z0-4]*$/ works, doesn't it?
Jan 16, 2014 at 20:49 history asked Cruncher CC BY-SA 3.0