Regexp help (simple)

From: Date: Tue, 20 Jan 2004 08:59:37 +0000
Subject: Regexp help (simple)
Groups: php.general 
Request: Send a blank email to php-general+get-175107@lists.php.net to get a copy of this message
Hi! Anyone who could help me with this regexp problem? I want to verify that a string is made up of 2-3 letters, (a-z + åäö, A-Z + ÅÖÄ), directly followed by 4 or 5 digits, which could, but may not, be followed by a minus and one or two digits. Examples of valid strings: abc12345 ABC12345 abc1234 ABC12345-1 ABC12345-01 I would also like to split them into an array consisting of 2 elements; [0] = the first 2 or 3 letters [1] = the rest Example: string = ab12345 [0] = ab [1] = 12345 string = åäö1234-66 [0] = åäö [1] = 1234-66 Lots of thanks in advance, sincerely Victor

« previous php.general (#175107) next »