954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Regular Expressions

How can I write regular expressions(REs) for any language that are syntactically correct.

For example, Turkish has two classes of vowels — front and back. Vowel harmony states that words may not contain both front and back vowels. Therefore, most grammatical suffixes come in front and back forms, e.g. Türkiye'de "in Turkey" but kapıda "at the door".
front = { a, ı, o, u }
back = { e, i, ö, ü }

And how can I draw a Finite Automato for these REs

Can anyone give me simple examples.
I will try to write regular expression for the whole grammar of language and than write the code in C. But need some starting point.

a.baki
Newbie Poster
12 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 

Why would you need regex. I can think of a way to do that without it.

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

I supposed to do so.

a.baki
Newbie Poster
12 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 

Write one with three states: one for where it hasn't seen any vowels yet, one for where it's seen front vowels, and one for where it's seen back vowels. And a failure state if it has to be a deterministic FA. I'll leave the edges to you.

Rashakil Fol
Super Senior Demiposter
Team Colleague
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You