Alright, I solved the problem. Here is the code for converting final
letters in the middle of a word to normal letters, if anyone ever
needs it:
$text=עברית מבולגנת;
function hebrewNotWordEndSwitch ($from, $to, $text) {
$text=preg_replace('/'.$from.'([א-ת])/u','$2'.$to.'$1',$text);
I'm trying to make a regex that will change kaf, mem, nun, pe, and
tzadik to their final form if they are at the end of a word. On the
php mailing list, we came to this regex, which works to replace a
letter only at the end of a word, and it works well:
$text=preg_replace('/\b([^\s]+)a\b.*/U',
On 2/28/08, Dotan Cohen [EMAIL PROTECTED] wrote:
I'm trying to make a regex that will change kaf, mem, nun, pe, and
tzadik to their final form if they are at the end of a word. On the
php mailing list, we came to this regex, which works to replace a
letter only at the end of a word, and it
On 28/02/2008, shimi [EMAIL PROTECTED] wrote:
It can be a UTF-8 problem in general - PHP has many functions that are not
UTF-8 aware, which is why we have the mbstring functions... which are
equivalent to historical PHP functions, but work well on multibyte
strings... there's even an option to
Dotan Cohen wrote:
On 28/02/2008, shimi [EMAIL PROTECTED] wrote:
It can be a UTF-8 problem in general - PHP has many functions that are not
UTF-8 aware, which is why we have the mbstring functions... which are
equivalent to historical PHP functions, but work well on multibyte
strings... there's
On Thu, Feb 28, 2008 at 12:34:42PM +0200, Dotan Cohen wrote:
I'm trying to make a regex that will change kaf, mem, nun, pe, and
tzadik to their final form if they are at the end of a word. On the
php mailing list, we came to this regex, which works to replace a
letter only at the end of a