Is there a way in PHP, that you can convert the following regular expression
3.0, 3.1, 3.2, 3.3
You can use the
or to make the regex a bit more readable.
Also note the escaping of
. is a special character in regex and means "any character" your regex as is would have allowed more than just
3.3. You also should use anchors to ensure that is the only value in the string. So a final version (without delimiters):