Matching strings with letters and a semicolon
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Matching strings with letters and a semicolon
How can I use preg_match to match only letters, a semicolon, and spaces?
-
GuitarheadCA
- Forum Newbie
- Posts: 20
- Joined: Fri Jul 13, 2007 12:59 am
Close..
Code: Select all
preg_match('#^[a-z;\s]*$#i', $string);- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Thanks, both didn't work. Maybe its my logic.
I have an array:
Note: Extra can be any text with or without spaces.
I want to match only a part of the array that has text in the format of part 5 above.
Thanks!
I have an array:
Code: Select all
Array ( [0] => 05 [1] => 35 [2] => 03 [3] => 33 [4] => 18 [5] => Extra: 01 )I want to match only a part of the array that has text in the format of part 5 above.
Thanks!