[ragel-users] how to match beginning and end of payload.

Ming Fu ming.fu at netsweeper.com
Fri Mar 23 20:30:59 UTC 2012


Hi,

I was trying to write a ragel equivalent of regular expression /^a.*b$/. 
Basically matching input that start with 'a' and end with 'b'. The 
document did not specifically say the $ of regular expression is supported.

If I write something like:

my_pattern = ( a ) > { if (*pe == 'b' )
                                          action_match;
                                      else
                                          action_no_match ;
                                    };

main := my_pattern | some_other_patterns;


what kind of action will cause the my_pattern to reach the final state 
of the successful match of main?

Best Regards,
Ming




_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users



More information about the ragel-users mailing list