|
-
April 12th, 2004, 03:58 AM
#1
Regular Expressions
Hi,
I would like to know how I can implement a regular expression
for the following in C Language...
Assignment
For
Switch
Please provide me the answer it's urgent
Thanks in advance
-
April 12th, 2004, 06:53 AM
#2
Not easily. I tend to build up a parse tree for each character in a string.
I bet if you search this website as well as www.codeproject.com you'll find a few answers to your question.
I've implemented regular expression pattern matching before and basically I build up a list of elements with each character being either
(a) A character
(b) A control character (wildcard etc).
Then I use this to attempt to 'match' other strings to it.
Darwen.
-
April 12th, 2004, 01:57 PM
#3
If you want a ready made regular expression library, definetly checkout the regex class at http://www.boost.org.
-
April 12th, 2004, 03:53 PM
#4
Regular expressions should be used to tokenize your input. Your syntactical and semantical analyzers should determine if the input is valid. Thus you'll want to tokenize the language into its keywords, not into its statements.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|