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.