<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>validate email address without Regex</title><link>https://community.appian.com/discussions/f/new-to-appian/20981/validate-email-address-without-regex</link><description>please tell me how to validate email address without regex means with the help of like function . 
 
 I am writing this expression : like(ri!email,&amp;quot;*@gmail.com&amp;quot;) 
 but i want to validate every field like first character should not be digit and all .help</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: validate email address without Regex</title><link>https://community.appian.com/thread/107812?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 07:44:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3efeddb2-4395-4654-9ff7-e565cbcb5a18</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Did you try to use the validations parameter of your text field?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: validate email address without Regex</title><link>https://community.appian.com/thread/107811?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 07:42:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7b4cb988-6905-4d04-81e9-0bb347e91e55</guid><dc:creator>nehai0002</dc:creator><description>&lt;p&gt;How to show a custom error message when the validation doesn&amp;#39;t pass?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: validate email address without Regex</title><link>https://community.appian.com/thread/81752?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 22:56:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:197ce288-2021-483c-8f97-691cc41c4512</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="26843" url="~/discussions/f/new-to-appian/20981/validate-email-address-without-regex/81750#81750"]Unless Appian comes out with a &amp;quot;isValidEmail&amp;quot; function out of the box[/quote]
&lt;p&gt;Yeah, and I&amp;#39;ve always been a little confused as to why this isn&amp;#39;t just a usable function, because various places within Appian *certainly* do seem to do their own validation on proper email address formatting.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edited to add (&lt;em&gt;2023-02-13&lt;/em&gt;)&lt;/strong&gt;, the &lt;span style="text-decoration:underline;"&gt;People Functions plug-in&lt;/span&gt; now has an email address validation function built-in, and it passes all the same test cases that I use against my RegEx version above, if this helps anyone.&amp;nbsp; Once again I beg everyone not to avoid using plug-ins for arbitrary reasons, they are in many cases essential to not having to reinvent the wheel over and over again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: validate email address without Regex</title><link>https://community.appian.com/thread/81750?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 22:00:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:875ef965-5ab7-4f02-b9af-c0d1d1d1c037</guid><dc:creator>davel001150</dc:creator><description>&lt;p&gt;I&amp;#39;m usually the one to jump on &amp;quot;you&amp;#39;re using Regex WAY too quickly&amp;quot; but in this case, it looks like regex is much more efficient.&lt;/p&gt;
&lt;p&gt;Unless Appian comes out with a &amp;quot;isValidEmail&amp;quot; function out of the box,&amp;nbsp;regex&amp;nbsp;may be your best bet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: validate email address without Regex</title><link>https://community.appian.com/thread/81724?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 13:57:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c51d6a2c-c0ee-433d-87b2-94ba38fd7ece</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Thanks&amp;nbsp;!&amp;nbsp; The above code, as its own expression rule, has helped me out in various different Appian projects since I originally wrote it, especially those where we didn&amp;#39;t (yet) have the RegEx plug-in.&amp;nbsp; For what it&amp;#39;s worth, since then I&amp;#39;ve swapped it out with the actual RegEx functionality as it&amp;#39;s able to handle a little bit more.&amp;nbsp;&amp;nbsp;&lt;a href="/members/saurabhs0003"&gt;saurabh sharma&lt;/a&gt;&amp;nbsp;is there a reason you can&amp;#39;t use the RegEx plug-in?&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the current code (still in an expression rule i.e. `UTIL_isValidEmailAddress()`) --&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;regexmatch(
  pattern: &amp;quot;^[A-Z0-9\_-]+(\.{0,1}[A-Z0-9\+_-]+)*[@]{1}[A-Z0-9.-]*[A-Z0-9-]+[.]{1}[A-Z]{2,6}$&amp;quot;,
  searchString: ri!email,
  regexFlags: &amp;quot;si&amp;quot;
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: validate email address without Regex</title><link>https://community.appian.com/thread/81716?ContentTypeID=1</link><pubDate>Mon, 17 May 2021 05:56:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e431249e-2fd2-49e1-867b-8450f56cc6fb</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Thanks to&amp;nbsp;&lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt;&amp;nbsp;there is existing code.&lt;/p&gt;
&lt;p&gt;&lt;a href="/discussions/f/administration/7353/way-to-validate-email-addresses"&gt;community.appian.com/.../way-to-validate-email-addresses&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After reading this&lt;/p&gt;
&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/2049502/what-characters-are-allowed-in-an-email-address"&gt;https://stackoverflow.com/questions/2049502/what-characters-are-allowed-in-an-email-address&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I think that email address validation is pretty ugly and not doable without regex. In case you want to rule out the most simple typos, then go with Mikes code. I just updated it to comply with latest changes in Appian&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!trimmed: trim(ri!address),
  if(
    or(
      isnull(local!trimmed),
      len(local!trimmed) &amp;gt; 255,
      length(split(local!trimmed, &amp;quot; &amp;quot;)) &amp;gt; 1,
      count(split(local!trimmed, &amp;quot;@&amp;quot;)) &amp;lt;&amp;gt; 2
    ),
    false(),
    a!localVariables(
      local!localPart: split(local!trimmed,&amp;quot;@&amp;quot;)[1],
      local!domainPart: split(local!trimmed,&amp;quot;@&amp;quot;)[2],
      if(
        or(
          length(split(local!domainPart, &amp;quot;.&amp;quot;)) &amp;lt; 2,
          contains(split(local!localPart, &amp;quot;.&amp;quot;), &amp;quot;&amp;quot;),
          contains(split(local!domainPart, &amp;quot;.&amp;quot;), &amp;quot;&amp;quot;),
          not(isnull(stripwith(lower(local!domainPart), &amp;quot;abcdefghijklmnopqrstuvwxyz1234567890-.&amp;quot;))),
          not(isnull(stripwith(lower(local!localPart), &amp;quot;abcdefghijklmnopqrstuvwxyz1234567890-._+&amp;#39;&amp;amp;%&amp;quot;)))
        ),
        false(),
        true()
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>