Question: Write the regex expression for the following criteria in java: prompt the user for their name in the form(Last, First) name should only accept: at
Write the regex expression for the following criteria in java:
prompt the user for their name in the form(Last, First)
name should only accept:
at least 1 comma
at least 1 space
alphabetical characters only
if user doesnt enter it exactly in this form(Last, First) it will display an error.
the regex should not accept anything but form(Last, First)
This means if they enter even "awdwdawdw, wdawdwad, adawawdwa" they will get error because it accept only 1 space and only 1 comma.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
