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: Regular Expressions

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Regular Expressions

    I have to write regular expressions, but it seems that I keep doing something wrong.

    Here, I have to write an expression containing any of the words: linux windows solaris macos. Below, is my code.
    "[linux windows solaris macos]"

    Here, I have to write an expression that matches either a ddddddddd, or broken up with hyphens in the standard way: ddd-dd-dddd for a Social Security number. Below, is my code.

    "\\d{9}|\\d{3}-\\d{2}-\\d{4}"

    What am I doing wrong?


  2. #2
    Junior Member
    Join Date
    Feb 2014
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Regular Expressions

    I would really appreciate if someone could help me.

Similar Threads

  1. use of regular expressions in string.replaceAll
    By nesthead98 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: June 17th, 2012, 02:24 PM
  2. regular expressions
    By brad35309 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 5th, 2010, 09:30 PM
  3. Text Processing with Regular Expressions explained in Java
    By JavaPF in forum Java Programming Tutorials
    Replies: 1
    Last Post: August 6th, 2008, 03:03 AM
  4. Text Processing with Regular Expressions explained in Java
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 1
    Last Post: August 6th, 2008, 03:03 AM
  5. Java program to validate an email address using Regular Expressions
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 0
    Last Post: May 19th, 2008, 08:26 AM