infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Tcl Library
searching a string for a number
Kevin Crist
I am trying to validate test codes and making sure they dont have numbers in them. i have tried the following commands with no luck:
{[string is digit -strict $testCode]}
and
if {![regexp -all {[^0-9]} $testCode]} {
set errormsg "WARN: ORM Killed - Numeric test code: $patientAcct,
$parent/$placerid/$fillerid, $dept/$testCode/$priority,$ordertype/$orderStatus"
set actionFlag "KILL"
}
They only work if the whole test code is a number, i was hoping that it would work if only at least one character is a number. So i guess in a sense it is working but what do i have to add to search for any number?
Thanks.
Find more posts tagged with
Clovertech
Comments
david_barr
This should work:
if {[regexp {[0-9]} $testCode]} {
Tom Rioux
Try this:
{[string is alpha -strict $testCode]}
That will return a 1 if it is all alphabet characters and will return a 0 if there are any numbers in the string.
Or if you want to use regexp, try this since all you want is alpha characters.
regexp {^[A-Z]*$} $var
Hope this helps...
Tom Rioux