Hi Navneet,

Can you elaborate more? I could not follow you.

Thanks.

--- On Thu, 9/6/11, Navneet Gupta <navneetn...@gmail.com> wrote:

From: Navneet Gupta <navneetn...@gmail.com>
Subject: Re: [algogeeks] Regular Expressions Implementation
To: algogeeks@googlegroups.com
Date: Thursday, 9 June, 2011, 9:26 AM

So i assume your ask is given a string, check if it can be formed with the 
regular expression you have. Is that correct?
The above can be implemented easily with stacks.Ex - Reg Expression - a*bc*

And String - aabccc
Put all instances of char that are consecutive on the stack and then pop the 
top element and match it with the regex element (assume some pointer we have 
for regex), now you increment the regex pointer, if you see a different 
character and your stack is not empty, we get false condition.


If we see a *, we keep popping all instances of last seen character. Once all 
such characters are popped, you are ready to process remaining of string anf 
regex in similar fashion.


Thanks,Navneet
P.S. This example only had a *, while regex can have more such symbols such as 
? etc and problem will become little more complicated if we have multiple such 
characters.




On Thu, Jun 9, 2011 at 2:40 PM, Freak Algo <algofr...@yahoo.com> wrote:


Hi All,

How to implement the regular expressions in C language? I am looking for a 
generalized algorithm.






-- 

You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.

To post to this group, send email to algogeeks@googlegroups.com.

To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.


For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.










-- 

You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.

To post to this group, send email to algogeeks@googlegroups.com.

To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.


For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to