I have a string like this:
متن آزمایشی Demo Text 4 1.0.5 – متن آزمایشی
I want to grab only the English text "Demo Text".
I used this regex [a-zA-Z]
but it's only getting the first letter of the text.
I have a string like this:
متن آزمایشی Demo Text 4 1.0.5 – متن آزمایشی
I want to grab only the English text "Demo Text".
I used this regex [a-zA-Z]
but it's only getting the first letter of the text.
[a-zA-Z ]+
try this
preg_match_all('/[a-zA-Z ]+/sm', $text, $result, PREG_PATTERN_ORDER);
$result = $result[0];