April 30, 2010 at 3:33 pm
Everything i've seen online says the brackets are used for ranges. None of them talk about double digit ranges. It would be nice to check for numbers 10 to 30. I guees I'll have to do something like this: '[123][0-9]'.
Is that the only way?
the real problem that I'm having is that I'm trying to find date values in a string. Some dates are 02-22-2010 and some are 2-22-10.
The dates are not specific they can be literally any date.
April 30, 2010 at 3:55 pm
Range searches on dates are easy, if they are coded as dates. If they are coded as strings, that makes it more difficult, especially if the format of the dates is random.
So, is that case for you, character based dates with multiple formats?
April 30, 2010 at 3:58 pm
Yes, intermixed with words. Example: "Ted was born 12-02-98 at hospital."
How much worse can you get? lol.
April 30, 2010 at 4:10 pm
I'm going to find the first occurenc of a number and then count based on the occurence of dashes. If there is one dash such as 03-10, then i will count 5 from first number. If there are two dashes then i will count 8 characters. That is the only way i can see to do this.
April 30, 2010 at 6:27 pm
Jacob Pressures (4/30/2010)
I'm going to find the first occurenc of a number and then count based on the occurence of dashes. If there is one dash such as 03-10, then i will count 5 from first number. If there are two dashes then i will count 8 characters. That is the only way i can see to do this.
If the dates always appear in the mm-dd-yy format, then the pattern you should be looking for should be %[0-1][0-9]-[0-3][0-9]-[0-9][0-9]% and then substring out those 8 characters.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 3, 2010 at 7:10 am
thanks!
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply