extracting date information from string

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

rodneyt
Posts: 128
Joined: Wed Oct 17, 2018 7:32 am

Re: extracting date information from string

Post by rodneyt » Thu Sep 01, 2022 3:57 am

Stam - where's the smiley for {wild applause}?

stam
Posts: 2682
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: extracting date information from string

Post by stam » Thu Sep 01, 2022 8:31 am

It just occurred to me that a date may be inside parentheses and not be preceded by a space… to cater for this just change the first operator \s to [\s|\(]
In other words the date should be preceded with a space or “(“.

I’ve not tested this exhaustively - if you encounter any issues/missed dates this can probably be adjusted to account for edge cases, just post the text that includes the date, or you can do this yourself using what I do: https://regex101.com/

Hope this helps
S.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”