Daniel0 Posted November 7, 2009 Share Posted November 7, 2009 Oh hell yeah: ^0$|^[0-9]*?(?:[13579][26]|(?(?<=^)[02468]?|[02468])[048])00$|^[0-9]*?(?:[13579][26]|(?:[2468][048]|[02468][48]|(?<=^)[048]))$ I rule!!1one!1 Link to comment https://forums.phpfreaks.com/topic/180264-notlast-day-of-the-month/page/2/#findComment-953111 Share on other sites More sharing options...
cags Posted November 7, 2009 Share Posted November 7, 2009 One 'Rule' to rule them all... I think I might have to do some reading to make sense of that... I believe the bit I don't understand is lookbehind, but having never used it, I don't know anything about it! Link to comment https://forums.phpfreaks.com/topic/180264-notlast-day-of-the-month/page/2/#findComment-953117 Share on other sites More sharing options...
Daniel0 Posted November 7, 2009 Share Posted November 7, 2009 This is a bit shorter: ^[0-9]*?(??:[13579][26]|(?(?<=^)[02468]?|[02468])[048])00|(?:[13579][26]|(?:[2468][048]|[02468][48]|(?<=^)[048])))$ Now I'm trying to get the >= 1582 into it. Edit: Okay... I can't be bothered to do that right now. I was thinking about either making something that matches numbers less than and then put it on the back with a negative lookbehind or creating one that matches greater than or equal with a positive lookbehind. Link to comment https://forums.phpfreaks.com/topic/180264-notlast-day-of-the-month/page/2/#findComment-953124 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.