I currently using regex.h for a c program
wanted to ensure a string starts and ends with the @ which surrounds alphanumeric chars, (only 2 @'s none in the middle)
UPDATE: I think i fixed the first question by using the ^ and $ anchor tags. If that doesn't look like the right way to fix the problem please let me know.
my code right now:
(regexCheck(tag, "^[@]+[A-Za-z0-9]+[@]$") == 1)
additionally i wanted to make sure a string contained an _ with alphanumeric chars (eg. _test , te_st, test_ are all valid, but test is not valid)
my code right now:
(regexCheck(string, "[A-Za-z0-9_]")) == 1
Any help would be appreciated, but an explanation with regex grammar would also be appreciated.