Re: [PHP] Regexp help (simple)

2004-01-22 Thread Martin Luethi
maybe this work: replace the special-characters first, eg.: $bokid = str_replace("å", "_", $bokid); and replace them back after preg_match or try the preg_match with the hexcode of this special chars: \xhh character with hex code hh (http://ch2.php.net/manual/de/pcre.pattern.syntax.php) g. martin

Re: [PHP] Regexp help (simple)

2004-01-22 Thread Victor Spång Arthursson
2004-01-22 kl. 10.40 skrev Dagfinn Reiersøl: I assume you mean: $test = split_bokid("ääö12345"); Yes! I don't know. It works fine on my computer. The letters display correctly on the command line and even in Mozilla. Hmmm… try the following:

Re: [PHP] Regexp help (simple)

2004-01-22 Thread Dagfinn Reiersøl
Victor Spång Arthursson wrote: Have been playing around a bit with this code, but I can't get it to work with international characters… For example, if I feed my function: function split_bokid($bokid) { if (preg_match('/^([a-zåäö]{2,3})([0-9]{4,5}(\-[0-9]{1,2}){0,1})$/ i',$bo

Re: [PHP] Regexp help (simple)

2004-01-21 Thread Victor Spång Arthursson
2004-01-20 kl. 10.41 skrev Dagfinn Reiersøl: [EMAIL PROTECTED] wrote: $string = 'ab12345-1'; if (preg_match('/^([a-zåäö]{2,3})([0-9]{4,5}(\-[0-9]{1,2}){0,1})$/i', $string, $m='')) { echo $m[1]; // -> ab echo $m[2]; // -> 12345-1 } g. martin luethi You can replace {0,1} with a question mark a

Re: [PHP] Regexp help (simple)

2004-01-20 Thread Dagfinn Reiersøl
[EMAIL PROTECTED] wrote: $string = 'ab12345-1'; if (preg_match('/^([a-zåäö]{2,3})([0-9]{4,5}(\-[0-9]{1,2}){0,1})$/i', $string, $m='')) { echo $m[1]; // -> ab echo $m[2]; // -> 12345-1 } g. martin luethi You can replace {0,1} with a question mark and [0-9] with \d (digit). Also, and I think

Re: [PHP] Regexp help (simple)

2004-01-20 Thread php
$string = 'ab12345-1'; if (preg_match('/^([a-zåäö]{2,3})([0-9]{4,5}(\-[0-9]{1,2}){0,1})$/i', $string, $m='')) { echo $m[1]; // -> ab echo $m[2]; // -> 12345-1 } g. martin luethi Tue, 20 Jan 2004 09:59:37 +0100 Victor Spång Arthursson <[EMAIL PROTECTED]>: > Hi! > > Anyone who could help m