RegEx in php for "comma, space or one line"?
I have a textarea field in my webpage. I accept user input, I want to parse this user input for "(SEPARATE BY COMPASS, SPACES OR ONE PER LINE)" this line.
Basically, I want to get words separated by comma, space or one per line. What can be RegEx for this, what can I use as below:
preg_split('/[,; " "]+/', $_tags);
I am already using regEx to separate user-entered tags. What would be the regEx to extract a word from a string that is "(SEPARATELY COMPASSES, SPACES OR ONE PER LINE)"
thank
+2
source to share
2 answers