I need regex that will match this
Fred, Jhon, Tree,
and there could be some spaces between the commas and the words, and between the start of the line and the first word. Can anyone help me with this ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simple explanation: / */ is a regex that matches space zero or more times. Fred matches Fred, John John, etc pp use / +/ instead if you wish at least one space
^ matches the start and $ the end.
note: using /\s*/ fragments instead of / */ fragments matches all whitespace – including tabs, newlines, etc