I need to validate if the list is line delimited and in a valid email format using regex in paragraph field . If not , throw a validation message.test@test.com
test2@test.com
test3@test.com
Discussion posts and replies are publicly visible
OK, and what is the question? For using regular expressions, you can use the plugin Regular Expression Functions from App MArkt....
For validating an email address you can certainly contrive a complex regular expression to test for validity, though these days I just recommend using the "validateEmailAddress()" rule found in, i think, People Functions.
As far as "line delimited" - you'll need to implement your own parsing / checking for that part, depending on exactly what you want. It could be as simple as splitting the input on the linebreak character (char(10)) then validating each (non-empty) line in the resulting set - that would simply require looping over the validate email function.
You can try this:
regexmatch( pattern: "^[A-Z0-9\'\+\&\%_-]+(\.{0,1}[A-Z0-9\'\+\&\%_-]+)*[@]{1}[A-Z0-9.-]*[A-Z0-9-]+[.]{1}[A-Z]{2,6}$", searchString: ri!email )
Depending on your actual use case, this might be a good fit.
https://appian.rocks/2023/12/04/the-master-of-email-address-fields/
in that code, if we enter incorrect email address format it is not throwing any validation error,it is saving only correct email address for incorrect ones nothing is displayed as error
I try to use the built-in Appian function for this as well. If that is not enough, I'll look at a regex solution.
I have an expression rule where I added ~18 extended test cases - edge cases to try to break the validation function - a while ago I developed a RegEx that handles all of them, and the plug-in rule (which came later iirc) handles all of them as well. I switch back and forth regarding which version to use - i haven't noticed any major performance difference between them (and they both use a plug-in ultimately so it's not like either version saves a dependency).
ZAINAB said:it is not throwing any validation error
you'll need to share what you've tried if you hope to find additional help with getting a validation message to show up. this is not much info to go on.
True. Feel free to adapt the code to do whatever you need it to do.
Hi Kraty Maheshwari , if i use the above code then if space is present at beginning or at the end ..it is throwing error .can you please help me with this