I have difficulties with regex. I just need to split a string of entries.
Input: "arg1 arg2 arg3 arg4"; Output: [arg1, arg2, arg3, arg4]
Input: "arg1 'arg 2' arg3 arg4"; Output: [arg1, arg 2, arg3, arg4]
My problem is in the second example. For when the argument is in quotation marks, I must keep it intact. And as I'm using PHP's explode function, I end up having two arguments ( [arg, 2]
);