Results 1 to 1 of 1
- 07-14-2011, 12:52 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 1
- Rep Power
- 0
Pattern problem (capturing groups)
Hi all,
I am trying to match strings that consist of two identical vowels. This should be a super-easy task, but somehow it doesn't work. My regular expressoin is "([aeiou])\1".
The following statement returns false:
Pattern.matches("([aeiou])\1", "aa");
Can anyone help? It is my first time using capturing groups so I may be doing something wrong. However, the examples I read here seem to indicate I am doing it fine?
Thanks in advance.
EDIT: Oh nevermind, I just needed to escape the backslash... "([aeiou])\\1".Last edited by BMF; 07-14-2011 at 12:57 PM.
Similar Threads
-
Video Capturing Problem from JMStudio
By asifzbaig in forum Advanced JavaReplies: 0Last Post: 05-28-2011, 09:07 PM -
Groups of swing objects
By plrca2 in forum AWT / SwingReplies: 12Last Post: 12-07-2010, 02:56 AM -
pattern matcher problem
By shashanksworld in forum New To JavaReplies: 1Last Post: 04-02-2010, 02:55 AM -
Problem with observer pattern
By livnihai in forum New To JavaReplies: 5Last Post: 10-11-2009, 02:34 PM -
Capturing Groups using regular expressions
By Java Tip in forum Java TipReplies: 0Last Post: 12-25-2007, 11:19 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks