Dyslexia
-
Not entirely sure that this should be classed as subtle, but somehow I missed it for the last 30 minutes whilst it was staring me in the face. The problem was simple, I needed to find 'go' in a sql script to execute the preceeding DDL statements. So I wrote this .. Regex goRegex = new Regex(@"$\s*GO\s*^", RegexOptions.IgnoreCase); How did I miss it? :doh: Lest to say, when nothing was executed I looked everywhere but there.
Bar fomos edo pariyart gedeem, agreo eo dranem abal edyero eyrem kalm kareore
-
Not entirely sure that this should be classed as subtle, but somehow I missed it for the last 30 minutes whilst it was staring me in the face. The problem was simple, I needed to find 'go' in a sql script to execute the preceeding DDL statements. So I wrote this .. Regex goRegex = new Regex(@"$\s*GO\s*^", RegexOptions.IgnoreCase); How did I miss it? :doh: Lest to say, when nothing was executed I looked everywhere but there.
Bar fomos edo pariyart gedeem, agreo eo dranem abal edyero eyrem kalm kareore
Oops :) I'd actually suggest using
\bGO\b
since\s*GO\s*
would match "BOBGOBOB" too - GO surrounded by any number (including zero) of spaces.--Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen
-
Not entirely sure that this should be classed as subtle, but somehow I missed it for the last 30 minutes whilst it was staring me in the face. The problem was simple, I needed to find 'go' in a sql script to execute the preceeding DDL statements. So I wrote this .. Regex goRegex = new Regex(@"$\s*GO\s*^", RegexOptions.IgnoreCase); How did I miss it? :doh: Lest to say, when nothing was executed I looked everywhere but there.
Bar fomos edo pariyart gedeem, agreo eo dranem abal edyero eyrem kalm kareore
-
You have * instead of +? Ooo, I see now, I never know which way they go either ;P My saturday morning subtle bug a few weeks back was: :-O
xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008)leppie wrote:
I hate it when code has to rely on string literals, which fail silently.
Deja View - the feeling that you've seen this post before.
-
Not entirely sure that this should be classed as subtle, but somehow I missed it for the last 30 minutes whilst it was staring me in the face. The problem was simple, I needed to find 'go' in a sql script to execute the preceeding DDL statements. So I wrote this .. Regex goRegex = new Regex(@"$\s*GO\s*^", RegexOptions.IgnoreCase); How did I miss it? :doh: Lest to say, when nothing was executed I looked everywhere but there.
Bar fomos edo pariyart gedeem, agreo eo dranem abal edyero eyrem kalm kareore
MidwestLimey wrote:
Not entirely sure that this should be classed as subtle
Sure it can. That is why I use Expresso when working with regex's :)
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham