I want to separate my sentence(s) into two parts. Because they are made of English letters and non english letters. I have regex I am using in preg_split method to get normal letters and characters. This though, works for opposite and I am left with only Japanese and not english.
String I work with:
すぐに諦めて昼寝をするかも知れない。 I may give up soon and just nap instead.
My attempt:
$parts = preg_split("/[ -~]+$/", $cleanline); // $cleanline is the string above
print_r($parts);
My result
Array ( [0] => すぐに諦めて昼寝をするかも知れない。 [1] => )
As you can see, I do get an empty second value. How can I get both the English and the non-English text into two different strings? Why is the English text not returning even if I use correct regex (from what I've been testing)?