SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast jessegavin's Avatar
    Join Date
    May 2003
    Location
    Minneapolis, MN USA
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    VBScript RegEx for Guitar Chords

    I made a regular expression to match Guitar Chords.

    [A-G](#|b)?([a-z]|[0-9])*

    This pattern should find any of the following:

    1) G
    2) Gmaj
    3) G7
    4) G#
    5) Gb
    6) G#min

    The pattern works for all of these except for #4. For some reason it will only return the 'G' instead of the full 'G#'. I find this very odd because if the chord is 'Gb', the regex will return the full 'Gb'.

    This pattern works fine in javascript. Is there anything special with the '#' character in RegEx for VBScript? I am using VBscript engine 5.6

    Thanks for any help.

  2. #2
    SitePoint Enthusiast jessegavin's Avatar
    Join Date
    May 2003
    Location
    Minneapolis, MN USA
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found the answer:

    ([A-G](#|b)*([a-z]|[0-9])*)(/[A-G](#|b)*([a-z]|[0-9])*)*

  3. #3
    SitePoint Zealot Thermit's Avatar
    Join Date
    Mar 2005
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's cool, what are you doing with it exactly?

  4. #4
    SitePoint Enthusiast afgmail's Avatar
    Join Date
    Jan 2005
    Location
    Houston, TX
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also think it's cool, I have no idea what could I use it for but sounds cool anyway!
    Scan completed....
    Brain not found.
    filecabin.com : Notepad2


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •