May 8, 2008 #1 DotNetGnat Programmer Joined Mar 10, 2005 Messages 5,548 Location IN hi, how should the regex look for numbers like 35TH 12TH 235TH thanks -DNG
May 8, 2008 1 #2 Clueful Technical User Joined Sep 2, 2007 Messages 18 2 or 3 digits followed by 2 letters? Code: /^\d{2,3}[a-z]{2}$/i Upvote 0 Downvote
May 8, 2008 1 #3 Bong Programmer Joined Dec 22, 1999 Messages 2,063 Location US You mean, to find them? That would be /(\d+)(TH)/. Then, $1 would be the number. _________________ Bob Rashkin Upvote 0 Downvote
You mean, to find them? That would be /(\d+)(TH)/. Then, $1 would be the number. _________________ Bob Rashkin
May 8, 2008 1 #4 brigmar Programmer Joined Mar 21, 2006 Messages 414 Location US If you're looking for ordinal numbers, then you can't just look for 'th'. There's also 'st', 'nd', and 'rd' to consider. A simplistic version would be: /(\d+)(st|nd|rd|th)/ although that would also accept 51th, 22rd and 90st Upvote 0 Downvote
If you're looking for ordinal numbers, then you can't just look for 'th'. There's also 'st', 'nd', and 'rd' to consider. A simplistic version would be: /(\d+)(st|nd|rd|th)/ although that would also accept 51th, 22rd and 90st
May 11, 2008 1 #5 tsuji Technical User Joined Jul 25, 2001 Messages 10,675 Location US [tt]var rx=/\b([0-9]*(1[0-9]th|[02-9](1st|2nd|3rd|[4-9]th))|(1st|2nd|3rd|[04-9]th))\b/i;[/tt] Upvote 0 Downvote
May 13, 2008 Thread starter #6 DotNetGnat Programmer Joined Mar 10, 2005 Messages 5,548 Location IN Sorry for the delay in my reply...I really appreciate all your replies...have stars... -DNG Upvote 0 Downvote