Answer the question
In order to leave comments, you need to log in
Prompt with regular expression
Can you please tell me how the regular expression will look like for extracting values from a string, separated by a semicolon with any number of spaces:
somestuff1;somestuff2; somestuff3; .... ; somestuffN
somestuff can contain any characters except a semicolon.
It is the usual regular expression (the use of metacharacters) that is of interest, and not the implementation in PHP-Shevsky or any other dialect.
Answer the question
In order to leave comments, you need to log in
well, in all languages with perl-like regular expressions there is a regular expression split, although here it will also be superfluous (preg_split, split, etc.). Or are you looking for a very sophisticated option?
(?:\ +)?([^;]*[^\ ;])(?:\ *)?
but still the split + trim option or analogues would be better.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question