Regular Expression for multiple emails

Hi! I have a jsp page that has an inputTextArea so the user can enter multiple email addresses. In the backing bean (after they submit) I tokenize thru it and add email addresses to an arraylist. I want to validate that they are correct format before adding to arraylist, but how do I do that in the backing bean? All regular expression examples I have seen are in jsp page and javascript. Any sample code / suggestions would be greatly appreciated - as I have not had much experience with regular expressions. Thanks!

Hi,
this could be a solution for your problem; I've created two regular expressions to find valid email- and http-addresses in fulltext or xml-text fields ;-)
HTTP:
(\\s|>|^)(?!(@|/|\\.))(http://|https://|ftp://|sftp://|www\\.)([A-Za-z0-9_-]{2,}\\.)+[A-Za-z]{2,4}[:]?(/|\\?|\\&|\\;|\\%|=|\\.|\\#|_|-|[A-Za-z0-9])*(?!(@))(?<=([A-Za-z0-9=]+))(\\s|\\W|_|<|$)
eMail:
(\\s|>|^)(?!(:|www\\.|\\.))[A-Za-z0-9_.-]+@([A-Za-z0-9_-]+\\.)+[A-Za-z]{2,4}(\\s|\\W|_|<|$)
sincerely
Hans Georg Filipp

Similar Messages

  • Regular Expression to validation email address

    I want to validate an Email address and I need a regular expression for validating the email address.
    Email address requirement:
    1) It should not start with numbers, say like [email protected]
    2) It should be limited to 65 characters long including domain name.
    3) It should not have numeric domain names like [email protected]
    ANy inputs will be great.
    Thanks

    AccountUser1 wrote:
    Oh ok. If domain names can begin with numbers and its valid, then I'do like to incorporate it. Thanks for the info.
    In that case let me rephrase my requirement:
    Email address requirement:
    1) It should not start with numbers, say like [email protected]
    2) It should be limited to 65 characters long including domain name.So, you just arbitrarily refuse to deal with entire classes of email addresses? Why?

  • Wat should be the regular expression for string MT940_UB_*.txt to be used in SFTP sender channel in PI 7.31 ??

    Hi All,
    What should be the regular expression for string MT940_UB_*.txt and MT940_MB_*.txt to be used as filename inSFTP sender channel in PI 7.31 ??
    If any one has any idea on this please let me know.
    Thanks
    Neha

    Hi All,
    None of the file names suggested is working.
    I have tried using - MT940_MB_*\.txt , MT940_MB_*.*txt , MT940*.txt
    None of them is able to pick this filename - MT940_MB_20142204060823_1.txt
    Currently I am using generic regular expression which picks all .txt files. - ([^\s]+(\.(txt))$)
    Let me know ur suggestion on this.
    Thanks
    Neha Verma

  • Billing document output needs to tigger for multiple emails.

    Hi Experts,
    We have a scenario wherein a single billing document output gets triggered for multiple emails. The requirement is to send the invoice layout copy to multiple emails where we maintain customer mail ids in customer master record.
    When tried ,we found option in customer master record and maintained multiple email ids to send the billing output.The system has considered first email id from customer master record and did not consider next mail ids from CMR. Could you please suggest how can we suffice this requirement .
    Thanks in advance.
    KV.

    Hi,
    Email Address is maintained in Table ADR6 against the address number of table BUT000 for a particaluar BP.
    If the custom code is used, following logic can be used:
    For multiple email address multiple entry will be there in ADR6 for the same address number. To send the correspondence to all email address, select all entries and concatenate them separated with semi-colon ( and pass the same to the email address field.
    This is working in our case where we are using a third party for creating and sending the PDF.
    Regards,
    Pranavjeet.

  • Can you establish different sounds for multiple emails?

    Can you establish different sounds for multiple email accounts? 

    Sorry no, sound/alerts is universal for different email accounts.

  • Triggering billing output for multiple emails

    Hi Experts,
    We have a scenario wherein a single billing document output gets triggered for multiple emails. The requirement is to send the invoice layout copy to multiple emails where we maintain customer mail ids in customer master record.
    When tried ,we found option in customer master record and maintained multiple email ids to send the billing output.The system has considered first email id from customer master record and did not consider next mail ids from CMR. Could you please suggest now how can we suffice this requirement .
    Thanks in advance.
    KV

    Dear Kv rekha,
    Check whether the following thread helps you.
    http://wiki.sdn.sap.com/wiki/display/Snippets/Howtosendmailtoadistributionlistoragroup+ID
    Thanks & Regards,
    Hegal K Charles

  • On my home PC, I operate with Windows XP and use Outlook Express for my email.  Can my Outlook Express address book be imported by my IPhone4

    On my home PC, I operate with Windows XP and use Outlet Express for my email.  Can my Outlook Express address list be imported to my IPhone4

    Not directly; OE is not supported by iTunes. You need full Outlook. Address Book in later versions of Windows is supported.

  • How do I set individual sound alerts for multiple email accounts?

    How do I set individual sound alerts for multiple email accounts?

    Here: http://www.guidingtech.com/15275/get-different-notifications-per-mail-account-io s-6/
    Long and short of it, the settings can be individually changed under Notifications. Select Mail and then the account you want to change the sound to.

  • How to form a regular expression for matching the xml tag?

    hi i wanted to find the and match the xml tag for that i required to write the regex.
    for exmple i have a string[] str={"<data>abc</data>"};
    i want this string has to be splitted like this <data>, abc and </data>. so that i can read the splitted string value.
    the above is for a small excercise but the tagname and value can be of combination of chars/digits/spl symbols like wise.
    so please help me to write the regular expression for the above requirement

    your suggestion is most appreciable if u can give the startup like how to do this. which parser is to be used and stuff like that

  • Using regular expressions for validation in i18n

    Can we use regular expressions for validation of inputs in a java application taking care of i18N aspects too. Zip code for different locales are different. Can we use regular expressions to validate zipcode inputs from different locales

    hi,
    For that shall i have to create individual patterns for matching the inputs from different locales or a single pattern will do in the case of validating phone nos. around the world, zip codes etc. In case different patterns are required, programmer should have a konwledge of difference in patters for different locales.
    regards
    sdas

  • Regular Expression for a Person's Name

    Hi,
    I am using the org.apache.regexp package and trying to find the regular expression for a person's name. It allows only the alphabetic string.
    I tried [a-zA-Z]+. But this also accepts the thing like "BUSH88", which is not what I want...
    Can anybody help me figure this out?
    Thanks in advance,
    Tong

    Hi,
    I am using the org.apache.regexp package and trying to
    find the regular expression for a person's name. It
    allows only the alphabetic string.
    I tried [a-zA-Z]+. But this also accepts the thing
    like "BUSH88", which is not what I want...
    Can anybody help me figure this out?
    Thanks in advance,
    Tongtry this:
    ^[a-zA-Z]+$
    the ^ represents the start of the String and the $ represents the end.
    So the expression is saying: "between the beginning and the end of the String there will only be alphbetical characters"

  • How to write the regular expression for Square brackets?

    Hi,
    I want regular expression for the [] ‘Square brackets’.
    I have tried to insert in the below code but the expression not validate the [] square brackets.
    If anyone knows please help me how to write the regular expression for ‘[]’ Square brackets.
    private static final Pattern DESC_PATTERN = Pattern.compile("({1}[a-zA-Z])" +"([a-zA-Z0-9\\s.,_():}{/&#-]+)$");Thanks
    Raghav

    Since square brackets are meta characters in regex they need to be escaped when they need to be used as regular characters so prefix them with \\ (the escape character).

  • Need a regular expression for the text field

    Hi ,
    I need a regular expression for a text filed.
    if the value is alphanumeric then min 3 char shud be there
    and if the value is numeric then no limit of chars in that field.[0-9].
    Any help is appriciated...
    thanks
    bharathi.

    Try the following in the change event:
    r=/^[a-z]{1,3}$|^\d+$/i;
    if (!r.test(xfa.event.newText))
    xfa.event.change="";
    Kyle

  • Regular Expression for /, \, #, -, & ‘

    Hi,
    Can anybody tell me the regular expression for provided characters.
    Code is preferable.
    Thanks in advance.

    "[-/\\\\#&']"

  • What is the regular expression for the end of a story?

    Forgive me if this is wrong forum for asking this, but I'm trying to use the Find command using GREP and I need to know the regular expression for the end of a story. (Or, the last character of a story.) Thanks in advance.

    I'd try search for .\z (that's a dot in front) which ought to find the very last character in the story, and replace with $0 and your additional text.
    You know you can use a keyboard shortcut to move your cursor to the end of any story, right? Ctrl + End on Windows, Cmd + End, I think, on Mac. Unless you want to do this to every single story in the document, I would think you might be just as well off to put your text on the clipboard, put the cursor in the story and hit the key combo followed by Ctrl/Cmd + V to paste.

Maybe you are looking for

  • Help!  Solution Manager removing documents

    I'm new to Solution Manager and I  have something very strange going on.  Whenever a document is signed as complete in acceptance review as soon as it is saved it disappears from the business process it was stored under.  If I find the document it st

  • Changing Oracle Base of OUI with Command line?

    Hi all, I'm trying install the latest version of the Oracle ODAC (11.2.0.1.2) on a Win-7 32bit machine. I have a batch file that works perfectly with XP SP3 that allowed me to use "set ORACLE_BASE=C:\oracle" in cmd and the directory would be reflecte

  • Adobe Updater Glitch after 10.5.2

    I have been running Adobe CS3 on my new Mac Pro (early 2008) without any real issues for the past couple weeks. The only problem is "Updates" was grayed out in the Help Menus ever since I switched to Leopard OS (10.5.1). I just ran the Combo-Updater

  • Making iphoto library available to other macs and pc's.

    In an earlier question I asked if there was a way to make the iphoto library one one computer available to other macs and pc's, and be able to upload pics to the main library and have the other computers see the new pics automatically. I was told tha

  • Using Airport Extreme BS with home stereo

    Our network's up and running; now we wonder what is involved in using the Airport Extreme to convey music to wireless speakers throughout the house. Since we need so many questions anwsered (what 3rd party equipment is compatible, how to set it up, w