You can validate string values against a regex in microflow too. Is there a specific reason why you wouldn't want to use the microflow expression?
isMatch('3024EL', '([0-9]+)([a-zA-Z]+)')
This offers the same capability as the regex.matcher class in Java.
See documenation page: https://world.mendix.com/display/refguide5/String+function+calls#Stringfunctioncalls-isMatch
I use IsMatch to validate but I want to capture the result of the match. in your example I want a list/object with 3024 and EL
Why not just do a regular expression with some string breakup? First check the string with this regex: ^[1-9][0-9]{3}\s?[a-zA-Z]{2}$ found here. Then take a look at the string function calls First check the length of the string if it is 6 or 7 (with the length function). Then do a substring ($zipcode,0,4) then you should have the four first digits. If the string is 6 do a substring ($zipcode,4,2) otherwise ($zipcode,5,2). You can parse the four part back to a number with the parsestring function.
Regards,
Ronald
Thanks Ronald :) the way you describe is do-able for small regexes but the postal code was an example. With more complex regexes (with 11 groups) I prefer a java action