🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7488

Re: check a string format

#7488
From: Fishface
Date: Sat, 22 Jan 2005 17:43
10 lines
1276 bytes
DaniD wrote:
> How can I check if a String has a format such as "hh:mm"?
> I want to be able to check if the inserted time is right.

You might also consider the VCL function MatchesMask()
Maybe *something like this* for a 24 hour clock:

if ( MatchesMask(Edit1->Text, "[0-1][0-9]:[0-5][0-9]") ||
    MatchesMask(Edit1->Text, "2[0-3]:[0-5][0-9]") )
    ShowMessage("Match");
Technical Details
Message-ID: <41f29090@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41efeefa@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,75a5742ba1befd01
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Fishface" <invalid@ddress.ok?>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <41efeefa@newsgroups.borland.com>
Subject: Re: check a string format
Date: Sat, 22 Jan 2005 09:43:17 -0800
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 209.102.127.80
Message-ID: <41f29090@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1106415760 209.102.127.80 (22 Jan 2005 09:42:40 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail