By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,799 Members | 1,359 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,799 IT Pros & Developers. It's quick & easy.

Reqex Help

P: n/a

How should I build a Regex that excepts only -12 through 12 integers only?
-12
-11
-10
-9
-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
3
4
5
6
7
8
9
10
11
12

Thanks

Thomas

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
thomasp@... wrote:
How should I build a Regex that excepts only -12 through 12 integers
only?


You should not. Regex is for strings, not numbers.

How about

if x >= -12 andAlso x <= 12 andAlso x = int(x) then
' do something
end if

Andrew
Nov 21 '05 #2

P: n/a
I am using the entry as text, but your suggestion will work fine.

Thanks

Thomas

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.