Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check if string contains only numeric value if range is not given
#1
Solved: 10 Years, 9 Months ago
Hi,

In my application, when new object is created, a new window opens with title: object's name and its ID.

e.g. ABC 45732547 or ABC 8679

ABC is object's name and ID is only numeric value which keeps increasing and its range is not given.

can anyone tell me the regular expression to check only for numeric value after object's name. e.g. "ABC 564jhj44" should not work.
Reply
#2
Solved: 10 Years, 9 Months ago
One way to do it is, store that windows title in a variable.
Split this variable so that ABC and 8679 or whatever are separate.
Now use Cint and then check with IsNumeric function.
Reply
#3
Solved: 10 Years, 9 Months ago
You can also use regular expresion to do this.
here is the regular expressionto verify this
.* \d*

Allows only "asdfsdf 1232451234" it will not allow "asdfasd 123sdf123"
Reply
#4
Solved: 10 Years, 9 Months ago
objRegExpr.Pattern = "[A-Za-z]+ ?[0-9]"

regards
Kishore
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  trying to test that field doesn't have numeric characters jayraocourts 0 1,027 10-25-2019, 12:54 AM
Last Post: jayraocourts
  Regular Expression- For a Numeric rajeshvelur 3 3,288 11-29-2008, 11:04 PM
Last Post: surya_7mar

Forum Jump:


Users browsing this thread: 1 Guest(s)