Thread: Match vowels

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    2
    Rep Power
    0

    Post Match vowels


    Hi I'm trying to get the vowel "u" between two other vowels.
    For example:
    treuas -> get the "u" because it's between "e" and "a"
    louder -> dont get anything because "u" is not between two vowels
    I tried this expression: (?:[aeiou])[u](?=[aeiou]) but it works partially because I get the "u" but also the vowel before the "u".
    Any ideas?
    thank you
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Hi,

    you mixed up the syntax. A lookbehind is written as

    Code:
    (?<=[aeiou])
    What you have (question mark, double colon) is a non-capturing subgroup.

    Comments on this post

    • requinix agrees : *non-capturing
    Last edited by Jacques1; August 29th, 2013 at 05:46 PM.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    2
    Rep Power
    0
    Yes!
    Thank oyu!!

    Originally Posted by Jacques1
    Hi,

    you mixed up the syntax. A lookbehind is written as

    Code:
    (?<=[aeiou])
    What you have (question mark, double colon) is a non-capturing subgroup.

IMN logo majestic logo threadwatch logo seochat tools logo