DaNuGai Posted September 15, 2009 Share Posted September 15, 2009 I am using the following regular expression ^([01]?[0-9]|2[0-3])(:([0-5][0-9]))$ It works fine. However, I just want to exclude the following matches 00:000:00Does anyone know how? Thanks in advance. Link to comment Share on other sites More sharing options...
justsomeguy Posted September 15, 2009 Share Posted September 15, 2009 This might work: ^(^00:00)(^0:00)([01]?[0-9]|2[0-3])(:([0-5][0-9]))$ Link to comment Share on other sites More sharing options...
DaNuGai Posted September 16, 2009 Author Share Posted September 16, 2009 Thanks for your reply but it doesn't work. I've tried the following strings and they all failed: 0:0000:0000:011:0001:0011:11I want a regular expression where the top two fails and rest of them should pass Link to comment Share on other sites More sharing options...
Ingolme Posted September 16, 2009 Share Posted September 16, 2009 It might be because this ^ only negates when between square brackets.See if this works: ^(?!0?0:00$)([01]?[0-9]|2[0-3])(:([0-5][0-9]))$ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.