Regular expressions
(Automatically adding template at the end of the page.)
(Adding message template to the top of the page)
Line 1: Line 1:
{{message|Write the content here to display this box}}
In OCL, a regular expression match could be performed using regExpMatch, which will return true/false.
In OCL, a regular expression match could be performed using regExpMatch, which will return true/false.



Revision as of 22:34, 16 June 2024

Write the content here to display this box

In OCL, a regular expression match could be performed using regExpMatch, which will return true/false.

The following example shows one way to decide whether a string is a valid email address or not.

'åke.öberg@mdriven.se'.regExpMatch('^[a-öA-Ö0-9+_.-]+@[a-öA-Ö0-9.-]+\.[a-zA-Z]{2,3}$')
This page was edited 95 days ago on 06/17/2024. What links here