Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to identify a roman numeral

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to identify a roman numeral

    Hello All, I am having trouble identifying a roman numeral. I need to separate the txt file by chapters so i use this pattern to do it, but it does not work.

    Pattern.compile("chapter [i+x*c*l*v*][i*x+c*l*v*][i*x*c+l*v*][i*x*c*l+v*][i*x*c*l*v+]")

    any ideas?

    thanks alot


  2. #2
    Member DavidFongs's Avatar
    Join Date
    Oct 2010
    Location
    Minneapolis, MN
    Posts
    107
    Thanks
    1
    Thanked 45 Times in 41 Posts

    Default Re: How to identify a roman numeral

    The link below has a good solution and explanation

    regex - How do you match only valid roman numerals with a regular expression? - Stack Overflow

Similar Threads

  1. Identify and avoid some of the pitfalls in learning to use generics
    By JackyRock in forum Java Theory & Questions
    Replies: 0
    Last Post: February 6th, 2010, 05:12 AM
  2. Roman Numbers
    By chronoz13 in forum What's Wrong With My Code?
    Replies: 14
    Last Post: December 12th, 2009, 02:19 AM