izuzak / noam

JavaScript library for working with automata and grammars for regular and context-free languages
http://ivanzuzak.info/noam/
Other
208 stars 33 forks source link

why this regex is not defined? #4

Closed RaminMiri closed 9 years ago

RaminMiri commented 9 years ago

<([:A-Za-z][-.:A-Za-z0-9](\s+[:A-Za-z][-.:A-Za-z0-9]\s=\s("[^"]"|'[^']'))|\/[:A-Za-z][-.:A-Za-z0-9])\s*|\/?>

ibudiselic commented 9 years ago

Hello Ramin!

Noam supports only a minimal syntax for regular expressions. In particular, it doesn't support character classes and has no predefined character classes (like \s). If I may ask, what is your use case i.e. what are you trying to do? If you need a regular expression to parse some text, you should just use the built in regexes in JavaScript. Noam is not meant to replace that in any way. Instead, its purpose is to provide an easy way to explore the relationship between regular expressions and finite automata. The automaton that would result from your expression would be pretty big and probably not very useful in that regard.

Best regards, Ivan

On Tue, Apr 14, 2015 at 7:05 PM, Ramin notifications@github.com wrote:

<([:A-Za-z][-.:A-Za-z0-9](\s+[:A-Za-z][-.:A-Za-z0-9]\s=\s("[^"] "|'[^']'))|\/[:A-Za-z][-.:A-Za-z0-9])\s*|\/?>

— Reply to this email directly or view it on GitHub https://github.com/izuzak/noam/issues/4.

RaminMiri commented 9 years ago

Hi Ivan, it's XML Regular Expressions for opening tag with attributes or a closing tag. Now I need to create DFA and I found out it's going to be complicated. ...but anyway thanks for your helpful simulator...and I appreciate if you know any other simulator that can help me with. thank you.

ibudiselic commented 9 years ago

Ah, I see. I can't recommend any other tool unfortunately.

Ivan

On Tue, Apr 14, 2015 at 8:52 PM, Ramin notifications@github.com wrote:

Hi Ivan, it's XML Regular Expressions for opening tag with attributes or a closing tag. Now I need to create DFA and I found out it's going to be complicated. ...but anyway thanks for your helpful simulator...and I appreciate if you know any other simulator that can help me with. thank you.

— Reply to this email directly or view it on GitHub https://github.com/izuzak/noam/issues/4#issuecomment-93017709.