I would like to ask about php’s preg_match_all. suppose we have the sample string below:
This is a clause with –value1– and -_value_2_- having a subclause of –value.3– items.
And i would like to extract all strings with the opening “-” and closing “-” characters. Needed output should be:
Array
(
[0] => Array
(
[0] => -_value1_-
[1] => -_value_2_-
[2] => -_value.3_-
)
)
Use one of the following simple regexps
/-.*?-/or/-.*-/U