Results 1 to 2 of 2
  1. #1
    torsion is offline Member
    Join Date
    Jun 2010
    Rep Power

    Default Regular expressions: named groups

    I am a python user and need to use java regular expressions. At python I can use something like this: pattern = "(?P<year>\d{4})" so, I can give a name to group. What about this in java?

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Rep Power


    The groups are numbered based upon the grouping order, which allows identification of grouping. Should be enough to pull out a specific group from the regex search
    Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)

Similar Threads

  1. Regular Expressions Help
    By Death Sickle in forum New To Java
    Replies: 4
    Last Post: 04-04-2011, 05:21 AM
  2. Regular Expressions problem
    By mohammedelbes in forum Advanced Java
    Replies: 7
    Last Post: 01-05-2011, 12:12 PM
  3. regular expressions
    By sozeee in forum New To Java
    Replies: 3
    Last Post: 12-06-2010, 10:58 PM
  4. Get all groups from a regular expression match?
    By johann_p in forum New To Java
    Replies: 0
    Last Post: 05-16-2008, 08:50 PM
  5. Capturing Groups using regular expressions
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-25-2007, 12:19 PM

Tags for this Thread

Posting Permissions

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