Regullar Expressions in Haskell


I need a implementation of a mechanism to identify the strings based on some regular expressions.


Requires the implementation of a function, "matches", which by receiving a regular expression and a string, determinate, in order, the longest disjoint sub-strings, that matches with the provided expression. For example, knowing that the regular expression "a + | b +" denotes the string which contains at least one character 'a' and strings containing at least one character 'b', this is what will return the application below:

> matches "a+|b+" "abbcccaaa"

["a", "bb", "aaa"]

For the expression "(a|b)+" the result is:

> matches "(a|b)+" "abbcccaaa"

["abb", "aaa"]

The elements that can appear in regular expressions are:

Small letters: a, b etc.

Sequence: ab, aabbb etc.

Parentheses for grouping.

? operator, Example: "ab?c" determine "abc", and with "ac".

"(ab)?c" determine "abc", and with "c".

* operator. Example:

"ab*c" determine "ac", "abc", "abbc" etc.

"(ab)*c" determine "c", "abc", "ababc" etc.

+ Operator. Example:

"ab+c" determine "abc", "abbc" etc., but not "ac".

"(ab)+c" determine "abc", "ababc" etc.,but not "c".

| Operator. Example:

"ab|c"determine"ab" and with "c".

"a(b|c)" determine "ab" and with "ac".

In the absence of parentheses, the prioritization of the operators from the strong to the weak, is as follows:

quantification?, *, +


alternation: |.

For example, the expression "ab * | c 'group is, therefore, as in" (a (b *)) | (c). An alterate method of expression syntax which alters the semantics of the original expression, is "a(b*|c)".

This project must use the parser given in the attachment.

I need this project done until 7 May 2013.

Skills: Haskell

See more: matches abbcccaaa, matches abbcccaaa aaa, what need for an operator, what is disjoint, what is a regular expression, use regular expressions, regular expressions in c, regular expressions example, regular expressions c, regular expression in c, regular expression function, regular expression example, regular expression 0, example regular expressions, example of regular expression, example of disjoint, disjoint, c regular expressions, c regular expression example, abb, aaa a, semantics, expressions, alterate, project haskell

Project ID: #4486650

2 freelancers are bidding on average $106 for this job


Hello, i'm VERY INTERESTED in this project, please see my private message

$111 USD in 0 days
(1 Review)

Hi, I am a computer scientist with strong knowledge in declarative programming. I know well functional programming languages like Haskell. Also I am expert in language recognition. You can see my portfolio.

$100 USD in 2 days
(0 Reviews)