Regular expressions inside the language

Dec 29, 2009 at 12:45 PM

Hi,

Thank you for this great work, can't wait for the final release!

One question please about the regular expression:

My final language some thing look like that:

 

MyCustomExpressions
{
       ExpressionOne "^[\n <"']*([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)"

       ExpressionTwo "^([1-9]{0,1})([0-9]{1})(\.[0-9])?$"
}

The question how I can represent the expression term ["^([1-9]{0,1})([0-9]{1})(\.[0-9])?$"] in the irony, I look at 'RegexBasedTerminal' but it seems for another purpose where we determine the pattern in its constructor, may be I just use the string literal, but asking if there is a better solution.

 

Thank you,

Coordinator
Dec 30, 2009 at 6:54 PM

As far as I understand these reg expressions, you need numbers with limited number of digits before and after the dot. Use NumberLiteral and handle ValidateToken event: in the event handler validate the content of the token and if it is invalid, report an error: replace the token with error token.