List Info

Thread: Matching variables




Matching variables
user name
2006-02-09 02:48:06
EDIT:
No space between * and whitespace characters
[A-z][A-z0-9_]*[tnrv].+[A-z][A-z0-9_]*



It even matches:
long long l

Matching variables
user name
2006-02-09 04:39:50
Nevermind, I think I got it. regex.h's thing for whitespace
doesn't
like the s character, but since I only needed space
characters, I
could just put a space where I wanted it. I'm putting this
up here so
anyone can get the answer:
^([A-z][A-z0-9_]*[&\*]?)([ ]+)([A-z_][A-z0-9_]*)$
will match any
variable type in C and C++.

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )