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 1 of 1

Thread: Help required

  1. #1
    Junior Member
    Join Date
    Nov 2021
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help with assignment

    So i have an assignment about username validation without using regex. I am a beginner and i am unable to think anymore.
    in the second task we want to verify whether a given username matches a given pattern.
    1.Usernames are represented as strings of lowercase letters, uppercase letters, numbers and special characters. Special characters are all other characters, that are not double quotation marks ('"') or slash ('/').
    2.A multiplicity is specified by any number after a character, which is marked with a slash ('/'). This means that this character can be appended zero to x times at this position in the username. (For example e/17 -> e can be appended zero to 17 times)
    3.Lowercase letters, uppercase letters as well as special characters can be assigned a multiplicity. Numbers can't be assigned a multiplicity.

    VVVictoria is a valid modification based on the V/2ictoria pattern.
    VVictoria and "Victoria" are also valid modifications of the V/2ictoria pattern.
    VVVVictoria is NOT a valid modification based on the V/2ictoria pattern.

    i did the 1 and 3 by myself but my beginner brain cannot think for number 2. Any ideas would be welcome. Regex is not allowed so thats a plus.

    So i have an assignment about username validation without using regex. I am a beginner and i am unable to think anymore.
    in the second task we want to verify whether a given username matches a given pattern.
    1.Usernames are represented as strings of lowercase letters, uppercase letters, numbers and special characters. Special characters are all other characters, that are not double quotation marks ('"') or slash ('/').
    2.A multiplicity is specified by any number after a character, which is marked with a slash ('/'). This means that this character can be appended zero to x times at this position in the username. (For example e/17 -> e can be appended zero to 17 times)
    3.Lowercase letters, uppercase letters as well as special characters can be assigned a multiplicity. Numbers can't be assigned a multiplicity.

    VVVictoria is a valid modification based on the V/2ictoria pattern.
    VVictoria and "Victoria" are also valid modifications of the V/2ictoria pattern.
    VVVVictoria is NOT a valid modification based on the V/2ictoria pattern.

    i did the 1 and 3 by myself but my beginner brain cannot think for number 2. Any ideas would be welcome. Regex is not allowed so thats a plus.
    Last edited by Norm; November 15th, 2021 at 10:38 AM. Reason: Duplicates

Similar Threads

  1. HELP required plz
    By Java girl in forum What's Wrong With My Code?
    Replies: 29
    Last Post: March 21st, 2014, 03:04 AM
  2. java JNI help required
    By Phoenix23 in forum Java Native Interface
    Replies: 1
    Last Post: March 22nd, 2013, 09:05 PM
  3. help required !
    By arvindbis in forum Web Frameworks
    Replies: 0
    Last Post: October 8th, 2011, 01:17 AM
  4. Help Required
    By javajim in forum Java Networking
    Replies: 0
    Last Post: March 4th, 2010, 09:48 AM
  5. Help required Please
    By nandhini in forum AWT / Java Swing
    Replies: 1
    Last Post: December 4th, 2009, 09:55 AM

Tags for this Thread