The pattern in Regex.Split
matches the delimiter and isn't included in the results. Looks like you want to split between the last Hebrew and first non-Hebrew character, eg :
Regex.Split(str,@"\p{IsHebrew} \P{IsHebrew}")
\p{}
captures a character that belongs to a specific Unicode character class or named block while \P{}
excludes it.
Unfortunately, this pattern will exclude the last Hebrew and first non-Hebrew character and return :
לא קיימת תוכנה לשליחת מיילים במכשיר, אנא פנה אלינו ישירות
oshecohen@gmail.com
Capture groups are used to include characters captured by a delimiter pattern in the results. Simply using a group though with (\p{IsHebrew}) (\P{IsHebrew})
will return each capture group as a separate result :
לא קיימת תוכנה לשליחת מיילים במכשיר, אנא פנה אלינו ישירות
ל
m
oshecohen@gmail.com
Vladi Pavelka's use of forward and back references fixes this and (?<=\p{IsHebrew}) (?=\P{IsHebrew})
will return the expected results :
Regex.Split(str,@"(?<=\p{IsHebrew}) (?=\P{IsHebrew})")
will return :
לא קיימת תוכנה לשליחת מיילים במכשיר, אנא פנה אלינו ישירות ל
moshecohen@gmail.com