Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. Dyslexia

Dyslexia

Scheduled Pinned Locked Moved Clever Code
databasetoolsregexhelpquestion
5 Posts 5 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MidwestLimey
    wrote on last edited by
    #1

    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

    M L P 3 Replies Last reply
    0
    • M MidwestLimey

      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

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • M MidwestLimey

        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

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        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)

        P 1 Reply Last reply
        0
        • L leppie

          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)

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          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.

          My blog | My articles

          1 Reply Last reply
          0
          • M MidwestLimey

            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

            P Offline
            P Offline
            Paul Conrad
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups