Text Processing - Valid Usernames Java Fundamentals
Здравейте, колеги! Не мога да се справя с кода. Задачата е следната:
Write a program that reads user names on a single line (joined by ", ") and prints all valid usernames.
A valid username is:
-
Has length between 3 and 16 characters
-
Contains only letters, numbers, hyphens and underscores
Examples
Input
sh, too_long_username, !lleg@l ch@rs, jeffbutt
Output
jeffbutt
Input
Jeff, john45, ab, cd, peter-ivanov, @smith
Output
Jeff
John45
peter-ivanov
Ето го и моето решение:
https://pastebin.com/ggaV9yw9
Благодаря много! :)