If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Best way to check for multiple characters in a string

I have pages that print Code 39 bar codes; however, I do not have development in place to dissalow the entry of the invalid characters that Code 39 requires. For this discussion, you dont' really need to knwo what Code 39 is, just the list of invalid characters.

So, upon data entry, I would like to check the string to ensure the following special characters are NOT present in the string, if they are, then I'll alert them or do something:

!
@
#
^
&
*
(
)
_
=
{
}
[
]
\
|
:
;
“
‘
<
>
,
?

Because there are so many characters to choose from, I am not certain the best code for this. What do you all suggest would be the best route to take?

The "^" after the opening "[" causes the character class in the regular expression to be inverted, meaning "match any character that is not a, b, c or d". I changed "[^" to simply "[". That should be all you need.

Code 39 (also known as "USS Code 39", "Code 3/9", "Code 3 of 9", "USD-3", "Barcode 3 of 9", "Type 39") is a linear barcode symbology that can encode upper-case alphanumeric A-Z and 0-9 and some special characters, with lower-case a-z added for Code 39 Extension.
Sorry, i have no ideas , but you can try to generate barcode in asp.net, including code 39 and other linear barcodes or 2D barcodes.

Code 39 (also known as "USS Code 39", "Code 3/9", "Code 3 of 9", "USD-3", "Barcode 3 of 9", "Type 39") is a linear barcode symbology that can encode upper-case alphanumeric A-Z and 0-9 and some special characters, with lower-case a-z added for Code 39 Extension.
Sorry, i have no ideas , but you can try to generate barcode in asp.net, including code 39 and other linear barcodes or 2D barcodes.

i heard if you use professional code 39 barcode generator to create code 39 barcode or other barcode types, it will automatically get the check digit and other characters for you, no need to choose from

Code 39 (also known as "USS Code 39", "Code 3/9", "Code 3 of 9", "USD-3", "Barcode 3 of 9", "Type 39") is a linear barcode symbology that can encode upper-case alphanumeric A-Z and 0-9 and some special characters, with lower-case a-z added for Code 39 Extension.
Sorry, i have no ideas , but you can try to generate barcode in asp.net, including code 39 and other linear barcodes or 2D barcodes.