I am trying to set an AMPscript function, that would check it the user provides a proper email name, in a proper format. If a user provides it in a wrong format, an error should appear.
For an error I will use "RaiseError" function, however, I don't know how to check if the structure of the email name string is correct.
The email name should be in the following structure: "xxxxx xxxxx - xxxx xxxx xxxx" - so the first part of the string should be separated by a dash from the second part of the string.
Which function would check if the user provides proper structure of email name?
I have already a function that catches for me the first part of the string (@sub_name):
var @index, @sub_name Set @index = IndexOf(emailname_,' -') set @sub_name = Substring(emailname_,1,Subtract(@index,1))