GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   really fast regular expressoin question (https://gfy.com/showthread.php?t=442287)

Zester 03-10-2005 02:39 AM

really fast regular expressoin question
 
how do I search a pattern for a numeric range?:

my $string="20050306"

I want to determine if 20050306 is between 20050101 and 20050608 with regex

using this:
$string=~m/[20050101-20050608]/

teksonline 03-10-2005 05:31 AM

Sounds like your going at it all wrong, if your string is 20050101-20050608
then

($begin_date, $end_date) = split ('-', $string);

if ($string => $begin_date) && ($string <= $end_date) {
do this


All times are GMT -7. The time now is 03:16 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123