OCLinEcore and Regex to create valid IPv4 string -
i have ecore model, i'm trying add ocl constraints.
my problem comes when try make property (a string) in valid ipv4 form. guess should use regular expression, have no idea @ how use regex on oclinecore.
as of eclipse juno, can use regular expressions in ocl. function call on matches(regex), in java.
context packet inv validipv4 : ip.matches('\b([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\b')
if have previous version of eclipse, suggest adding java constraint on ecore element, validate element through generated java template code.
Comments
Post a Comment