Count occurence of @ in validating email address peoplecode

183 Views Asked by At

I need to validate email address and check if the email address has only one @.

1

There are 1 best solutions below

0
On

You have several possibilities to solve it:

java.util.regex

Provide regular expression for email validation and try to match it against provided email.

Find(string, within_string [, number])

Return value will provide first occurence of search string. Use that value as a 3rd parameter to search for 2nd occurence.

Split(string, separator)

Test if length of returned array is equal to '2'

Other options:

  • search for email validation function within PeopleSoft delivered Application Classes
  • SQLExec with match / regex query