i was asked the same question in my Microsoft interview. I gave the solution using a naive method by comparing each letter and tracking the next character. If the next character is *, then set a flag and check the equality, and if it is a . ignore and move on. He was ok with the solution but said that, there is a better way.
On Sun, Dec 23, 2012 at 11:14 PM, Prem Krishna Chettri <[email protected]> wrote: > Well I can tell you Something about design pattern to solve this case.. > > What I mean is by using The State Machine Design Pattern, Anyone can > solve this. but Ofcourse it is complicated. > > > > > On Sun, Dec 23, 2012 at 11:01 PM, shady <[email protected]> wrote: >> >> that's the point, Have to implement it from scratch... otherwise java has >> regex and matcher, pattern to solve it........... >> >> >> On Sun, Dec 23, 2012 at 10:28 PM, saurabh singh <[email protected]> >> wrote: >>> >>> If you need to implement this for some project then python and java have >>> a very nice library >>> >>> >>> Saurabh Singh >>> B.Tech (Computer Science) >>> MNNIT >>> blog:geekinessthecoolway.blogspot.com >>> >>> >>> On Sun, Dec 23, 2012 at 7:48 PM, shady <[email protected]> wrote: >>>> >>>> >>>> http://stackoverflow.com/questions/13144590/to-check-if-two-strings-match-with-alphabets-digits-and-special-characters >>>> >>>> any solution for this......... we need to implement such regex >>>> tester................ >>>> >>>> some complex cases : >>>> string regex -> status >>>> >>>> reesd re*.d -> match >>>> re*eed reeed -> match >>>> >>>> can some one help with this ? >>>> >>>> -- >>>> >>>> >>> >>> >>> -- >>> >>> >> >> >> -- >> >> > > > -- > > --
