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. General Programming
  3. C#
  4. implementing wildcard match method

implementing wildcard match method

Scheduled Pinned Locked Moved C#
questionregextutorial
4 Posts 3 Posters 0 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.
  • A Offline
    A Offline
    AndrusM
    wrote on last edited by
    #1

    I need to implement vfp function which uses * and ? wildcards:

    static bool Like( cExpression1, cExpression2)

    cExpression1 Specifies the character expression that Like( ) compares with cExpression2. cExpression1 can contain the wildcards such as * and ?. The question mark (?) matches any single character in cExpression2 and the asterisk (*) matches any number of characters. You can mix any number of wildcards in any combination in cExpression1. cExpression2 Specifies the character expression LIKE( ) compares with cExpression1. returns true on wildcards match. How to implement this ?

    Andrus

    A P 2 Replies Last reply
    0
    • A AndrusM

      I need to implement vfp function which uses * and ? wildcards:

      static bool Like( cExpression1, cExpression2)

      cExpression1 Specifies the character expression that Like( ) compares with cExpression2. cExpression1 can contain the wildcards such as * and ?. The question mark (?) matches any single character in cExpression2 and the asterisk (*) matches any number of characters. You can mix any number of wildcards in any combination in cExpression1. cExpression2 Specifies the character expression LIKE( ) compares with cExpression1. returns true on wildcards match. How to implement this ?

      Andrus

      A Offline
      A Offline
      Anthony Mushrow
      wrote on last edited by
      #2

      You should look up Regex (Regular Expressions), it should do everything you need (and oh so much more)

      My current favourite word is: Nipple!

      -SK Genius

      Game Programming articles start -here[^]-

      1 Reply Last reply
      0
      • A AndrusM

        I need to implement vfp function which uses * and ? wildcards:

        static bool Like( cExpression1, cExpression2)

        cExpression1 Specifies the character expression that Like( ) compares with cExpression2. cExpression1 can contain the wildcards such as * and ?. The question mark (?) matches any single character in cExpression2 and the asterisk (*) matches any number of characters. You can mix any number of wildcards in any combination in cExpression1. cExpression2 Specifies the character expression LIKE( ) compares with cExpression1. returns true on wildcards match. How to implement this ?

        Andrus

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

        You should look at using regular expressions. Do a search on this site for Expresso, it is a really cool tool for building regular expressions.

        "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

        A 1 Reply Last reply
        0
        • P Paul Conrad

          You should look at using regular expressions. Do a search on this site for Expresso, it is a really cool tool for building regular expressions.

          "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

          A Offline
          A Offline
          AndrusM
          wrote on last edited by
          #4

          Thank you. I found this thread http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/32649965654df408/57ba3e39a6c2711f?lnk=st&q=#57ba3e39a6c2711f[^] which described that using regular expressions is not easy for this. Can yuo provide sample how to use regexps for this ?

          Andrus

          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