top_left top_right
bottom_left
Next Event: Unknown | Forum Rules | QGL Website | Event Registration
openFolder AusForums.com
iconwatfolderLineopenFolder LANs
iconwatfolderLineopenFolder QGL
iconwatfolderLineopenFolder QGL Forum
Author
Topic: regex help
mooby
Posts: 4059
Location: UK
is there anyway via regular expression to differ between two strings.

1. will be all numbers and have a max length of 6
2. will be all numbers and have a lenght of 20

system
--
mooby
Posts: 4060
Location: UK
... in dot net.
FraktuRe
Posts: 162
Location: Gold Coast, Queensland

* N U K E D *

Reason: Inappropriate
Click Here to See the Profile for FraktuRe Edit This Post Click Here to send FraktuRe an email Users HomePage Message User
Insom
Posts: 2276
Location: Brisbane, Queensland
not sure what you mean by "differ by", but


Imports System.Text.RegularExpressions

...

Dim re1 As New Regex("^\d{1,6}$") '' between one and six digits
Dim re2 As New Regex("^\d{20}$") '' twenty digits

If re1.IsMatch(inputString) Then DoCrap()
If re2.IsMatch(inputString) Then DoCrap()

...


dint least apt bandwagon ever
system
--
Not a new post since your last visit.
New Post Since your last visit
Back To Forum
Advertise with Us | Privacy Policy | Contact Us
© Copyright 2001-2026 AusGamers Pty Ltd. ACN 093 772 242.
Hosted by Mammoth Networks - Australian VPS Hosting
Web development by Mammoth Media.