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. Visual Basic
  4. regular expression

regular expression

Scheduled Pinned Locked Moved Visual Basic
regexhelp
3 Posts 2 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.
  • L Offline
    L Offline
    leezardd
    wrote on last edited by
    #1

    I would like to use a regular expression to evaluate text for a specific pattern. Here is the pattern and the rules: (A123.B12345678) the first character must be a letter, it must contain at least one character but no more than 8, no characters other than letters and numbers followed by a . and then the first character must be a letter, it must contain at least one character but no more than 8, no characters other than letters and numbers. I am currently using ^[a-zA-Z]\w*\.+\w{1,8}$ It's close but not quite what I need. All help greatly appreciated!

    C 1 Reply Last reply
    0
    • L leezardd

      I would like to use a regular expression to evaluate text for a specific pattern. Here is the pattern and the rules: (A123.B12345678) the first character must be a letter, it must contain at least one character but no more than 8, no characters other than letters and numbers followed by a . and then the first character must be a letter, it must contain at least one character but no more than 8, no characters other than letters and numbers. I am currently using ^[a-zA-Z]\w*\.+\w{1,8}$ It's close but not quite what I need. All help greatly appreciated!

      C Offline
      C Offline
      Charlie Williams
      wrote on last edited by
      #2

      Your requirements statement seemed to be a bit ambiguous, so I'm not exactly sure if I nailed it. [a-zA-Z]([a-zA-Z]|\d){0,7}\.[a-zA-Z]([a-zA-Z]|\d){0,7} a.B wanted true is True A6787.f9fds33 wanted true is True v387f56.c wanted true is True c.a546ff6 wanted true is True 234.f3455tt wanted false is False a123,ff00f9 wanted false is False a123..errew wanted false is False a123.a123.a wanted false is False Charlie if(!curlies){ return; }

      L 1 Reply Last reply
      0
      • C Charlie Williams

        Your requirements statement seemed to be a bit ambiguous, so I'm not exactly sure if I nailed it. [a-zA-Z]([a-zA-Z]|\d){0,7}\.[a-zA-Z]([a-zA-Z]|\d){0,7} a.B wanted true is True A6787.f9fds33 wanted true is True v387f56.c wanted true is True c.a546ff6 wanted true is True 234.f3455tt wanted false is False a123,ff00f9 wanted false is False a123..errew wanted false is False a123.a123.a wanted false is False Charlie if(!curlies){ return; }

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

        Sorry for the ambiguity. Your solution is exactly what I needed. Thank You!

        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