Pattern for email attribute validation.

I generated an schema for a web service which includes an email attribute, for which I developed a pattern to filter invalid emails but I'm getting facet errors during the schema object creation. My schema works perfectly well in XMLSpy but Oracle's XML parser/schema object fails.
the pattern I am using is:
"([a-zA-Z0-9_\\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)"
which includes some OR logic and nested patterns to validate the email.
I was able to track that using something like (([a-zA-Z0-9\-]+\.)+)) would not be correctly validated in Oracle's XML parser and that \. will cause the schema object creation to fail with facet errors.
I do not know if this is related to the current implementation of the validating parser or something else but I cannot find information on the current implementation that oracle supports (besides a version number). Where can I find information on this... does anyone happen to have a pattern which will validate email addresses and work under oracle parser?
Thanks,
Fedro

Yes, this may related to our implementation for the regular expressions.
Would you send me a simple test case at [email protected] If this is bug, we will fix it.
Thanks.

Similar Messages

  • Pl/sql stored procedure for email id validations

    hi i need a stored procedure that validates the email id is coreect or not

    ***PL/SQL code for Email validation***-
    DECLARE
    t_valid NUMBER(1);
    t_totallen NUMBER(2);
    t_counter NUMBER(2):=0;
    t_atpos NUMBER(2):= 1;
    i NUMBER(2) := 1;
    t_pointpos NUMBER(2):= 1;
    mail_ch VARCHAR2(1);
    result number; --:GR
    BEGIN
    t_totallen := LENGTH(:text_item_email);
    t_counter := t_totallen;
    i := 1;
    t_valid := 1;
    IF LENGTH(ltrim(rtrim(:text_item_email))) = 0 THEN
    t_valid := 0;
    ELSE
    --This is to check special characters are present or not in the email ID
    t_counter := t_totallen;
    WHILE t_counter > 0
    LOOP
    mail_ch := substr(:text_item_email,i,1);
    i := i+1;
    t_counter := t_counter -1;
    IF mail_ch IN (' ','!','#','$','%','^','&','*','(',')','-','','"',
    '+','|','{','}','[',']',':','>','<','?','/','\','=') THEN
    t_valid := 0;
    EXIT;
    END IF;
    END LOOP;
    --This is to check more than one '@' character present or not
    t_atpos := instr(:text_item_email,'@',1,2) ;
    IF t_atpos > 1 then
    t_valid := 0;
    END IF;
    --This is to check at minimum and at maximum only one '@' character present
    t_atpos := instr(:text_item_email,'@',1) ;
    IF t_atpos IN (0,1) THEN
    t_valid := 0;
    END IF;
    --This is to check at least one '.' character present or not
    t_pointpos := instr(:text_item_email,'.',1) ;
    IF t_pointpos IN (0,1) THEN
    t_valid := 0;
    END IF;
    --This is to check at least one character is present between @ and '.' :GR
    t_atpos := instr(:text_item_email,'@',1) ;
    t_pointpos := instr(:text_item_email,'.',1) ;
    IF t_pointpos-t_atpos<=1 THEN
    t_valid := 0;
    END IF;
    --This is to check at least one character is present after '.' :GR
    t_pointpos := instr(:text_item_email,'.',1) ;
    IF t_totallen-t_pointpos<=0 THEN
    t_valid := 0;
    END IF;
    END IF;
    if(t_valid=0) then
    message('Invalid Email');
    result:=show_alert('alert_email');
    raise form_trigger_failure;
    end if;
    END;
    ---***PL/SQL code for Name Validation***---
    DECLARE
    t_valid NUMBER(1);
    t_totallen NUMBER(2);
    t_counter NUMBER(2):=0;
    i NUMBER(2) := 1;
    name_ch VARCHAR2(1);
    --name_ch_ascii NUMBER;
    result number; --:GR
    BEGIN
    t_totallen := LENGTH(:text_item_first_name);
    t_counter := t_totallen;
    i := 1;
    t_valid := 1;
    IF LENGTH(ltrim(rtrim(:text_item_first_name))) = 0 THEN
    t_valid := 0;
    ELSE
    --This is to check if each character in name lies in the valid ascii range
    t_counter := t_totallen;
    WHILE t_counter > 0
    LOOP
    name_ch := upper(substr(:text_item_first_name,i,1));
    --name_ch_ascii := convert(name_ch,'US7ASCII');
    i := i+1;
    t_counter := t_counter -1;
    --IF name_ch_ascii not between 65 and 90 THEN
    IF name_ch not between 'A' and 'Z' THEN
    t_valid := 0;
    EXIT;
    END IF;
    END LOOP;
    END IF;
    if(t_valid=0) then
    message('Invalid First Name');
    result:=show_alert('alert_first_name');
    raise form_trigger_failure;
    end if;
    END;

  • Email id validation regexp

    Hello all,
    Can any body please help me in writing a reg exp for email id validation that would cover all possibilities of validating a email id?
    I had tried searching few on net but some test cases for the same faild.
    thanks in advance
    Aniruddha

    Ani-4-U wrote:
    Can any body please help me in writing a reg exp for email id validation that would cover all possibilities of validating a email id?
    I had tried searching few on net but some test cases for the same faild.
    Do you have actual requirements for this?
    Why does that matter - well look at the links posted and read them for the complexity of validating that an email address is valid in terms of the RFE that defines it.
    However, note that despite that such an address might not work at all. Even though it is perfectly valid.
    So if your requirements are to only accept email addresses that work then you need something quite a bite more complicated that simply validating that it meets the RFE. And if you don't need an address that actually works then does it matter if it is valid or not?

  • Email address validation, is there a way to use Regex or other fuzzy searching?

    I would like to use PL/SQL for Email address validation, is there a way to use Regex (regular expressions) or some other fuzzy searching for that? Using % and _ wildcards only take you so far...
    I need something that will verify alphanumeric charectors (no ",'.:#@&*^ etc.) any ideas?
    Current code:
    if email not like '_%@_%.__%' or email like '%@%@%' or email like '% %' or email like '%"%' or email like '%''%' or email like '%
    %' then
    The last line is to make sure there are no linebreaks in the middle of the email address, is there a better way to signify a line break, like \n or an ascii equivilent?

    Michael:
    The as noted in the previous post, DBI is a Perl package that allows Perl to talk to various databases, including Oracle. We use DBI on several UNIX servers, and it does not require ODBC, and I have always found it to be extremely quick. Things may be different in the Windows world.
    If you are spooling files out to run through Perl anyway, you may want to take a look at DBI. You could probably modify your existing scripts to use DBI fairly easily. The basic structure using DBI is like:
    use DBI;
    my dbh;       # A database handle
    my sth;       # A statment handle
    my sqlstr;    # SQL statement
    my db_vars;   # Variables for your db columns
    # Connect to the database
    $dbh = DBI->connect( "dbi:Oracle:service_name","user/password");
    $sqlstr = 'SELECT * FROM emp WHERE id = ?' # even takes bind variables
    #Prepare statement
    $sth = $dbh->prepare($sqlstr);
    $sth->execute(12345);  # Execute with values for bind if desired
    # Walk the "cursor"
    while (($db_vars) = $sth->fetchrow_array()) {
       your processing here

  • How to enter a valid Edit Pattern for Time?

    I'm tring to enter a pattern for the Edit Pattern and it kept giving me the invalid pattern error.
    Here is what I have for the Display Pattern: h:MM A
    And for Edit Pattern: h|hh|h:MM|h A|hh A|h:MM A|hh:MM A
    The textbox is set to Type: Date/Time Field.
    Help is appreciated.

    [email protected] wrote:
    > I'm tring to enter a pattern for the Edit Pattern and it kept giving me the invalid pattern error.
    >
    > Here is what I have for the Display Pattern: h:MM A
    > And for Edit Pattern: h|hh|h:MM|h A|hh A|h:MM A|hh:MM A
    >
    > The textbox is set to Type: Date/Time Field.
    >
    > Help is appreciated.
    The last two are the only valid edit patterns. All of the others are invalid. Here are the reasons:
    - You have to specify the minutes
    - If not using military hours (H, HH) you have to specify AM or PM
    The only way to support the other patterns you are trying to use is to make it a text field and put
    custom javascript validation on it.
    Justin Klei
    Cardinal Solutions Group
    www.cardinalsolutions.com

  • Email address validation pattern

    First off, I'm using JDK 1.4.2_07. What I'm trying to do is validate email addresses with the String.matches(String pattern) function. What I'm having a problem with is coming up with the regex pattern that represents any syntactically valid email address. If someone has a regex pattern that does represent any syntactically valid email address, I would appreciate it if you posted it in a reply to this message. Thanks!
    --Ioeth                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Here is the struts implementation of email address validation:
    <validator name="email"
    classname="org.apache.struts.validator.FieldChecks"
    method="validateEmail"
    methodParams="java.lang.Object,
    org.apache.commons.validator.ValidatorAction,
    org.apache.commons.validator.Field,
    org.apache.struts.action.ActionErrors,
    javax.servlet.http.HttpServletRequest"
    depends=""
    msg="errors.email">
    <javascript><![CDATA[
    function validateEmail(form) {
    var bValid = true;
    var focusField = null;
    var i = 0;
    var fields = new Array();
    oEmail = new email();
    for (x in oEmail) {
    if ((form[oEmail[x][0]].type == 'text' ||
    form[oEmail[x][0]].type == 'textarea') &&
    (form[oEmail[x][0]].value.length > 0)) {
    if (!checkEmail(form[oEmail[x][0]].value)) {
    if (i == 0) {
    focusField = form[oEmail[x][0]];
    fields[i++] = oEmail[x][1];
    bValid = false;
    if (fields.length > 0) {
    focusField.focus();
    alert(fields.join('\n'));
    return bValid;
    * Reference: Sandeep V. Tamhankar ([email protected]),
    * http://javascript.internet.com
    function checkEmail(emailStr) {
    if (emailStr.length == 0) {
    return true;
    var emailPat=/^(.+)@(.+)$/;
    var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
    var validChars="\[^\\s" + specialChars + "\]";
    var quotedUser="(\"[^\"]*\")";
    var ipDomainPat=/^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/;
    var atom=validChars + '+';
    var word="(" + atom + "|" + quotedUser + ")";
    var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
    var domainPat=new RegExp("^" + atom + "(\\." + atom + ")*$");
    var matchArray=emailStr.match(emailPat);
    if (matchArray == null) {
    return false;
    var user=matchArray[1];
    var domain=matchArray[2];
    if (user.match(userPat) == null) {
    return false;
    var IPArray = domain.match(ipDomainPat);
    if (IPArray != null) {
    for (var i = 1; i <= 4; i++) {
    if (IPArray[i] > 255) {
    return false;
    return true;
    var domainArray=domain.match(domainPat);
    if (domainArray == null) {
    return false;
    var atomPat=new RegExp(atom,"g");
    var domArr=domain.match(atomPat);
    var len=domArr.length;
    if ((domArr[domArr.length-1].length < 2) ||
    (domArr[domArr.length-1].length > 3)) {
    return false;
    if (len < 2) {
    return false;
    return true;
    }]]>
    </javascript>
    </validator>

  • Validation error message is not displayed for an attribute as an Input List Of Value

    Hi everyone,
    I use jdev 11.1.1.7.0
    In my application I've created an Entity Obj and a View Obj base Employees table.
    for the JobId attribute I've taken actions as listed below:
    1. in Employees EO I've created a validation for this attribute and in some cases an error message returns (the error message is "the salary is not high"):
         * Validation method for JobId.
        public boolean validateJobId(String jobid) {
            if (...) {
                return false;
            if (...) {
                return false;
            if (...) {
                return false;
            return true;
    2. in Employees VO  I've created a LOV for this attribute (the view accessor is JobsViewObj ) and I display the attribute as an Input Text with List Of Values.
    in jspx page I drag& drop this attribute as below:
              <af:inputListOfValues id="jobIdId"
                                    popupTitle="Search and Select: #{bindings.JobId.hints.label}"
                                    value="#{bindings.JobId.inputValue}"
                                    label="#{bindings.JobId.hints.label}"
                                    model="#{bindings.JobId.listOfValuesModel}"
                                    required="#{bindings.JobId.hints.mandatory}"
                                    columns="#{bindings.JobId.hints.displayWidth}"
                                    shortDesc="#{bindings.JobId.hints.tooltip}"
                                    autoSubmit="true">
                <f:validator binding="#{bindings.JobId.validator}"/>
              </af:inputListOfValues>
    I open the Popup and I select a row from the Popup list and then I click Ok. After that if the validation method(validateJobId) returns false, the error message("the salary is not high") must be show to the user. but the error message doesn't display. I don't understand why this happens.
    Can anybody guide me about this problem?
    Regards
    Habib

    yes, you're right, I've tested it in 12.1.3 and error message was displayed.
    it seems it's a bug(bad bug ) in both 11.1.1.7 and 12.1.2. and now what can I do? is there any way to display the the error message?
    Regards
    Habib

  • How to set which User Profile attribute is used for email messages?

    I am having a problem setting up User Profiles in SharePoint 2013. I have users that are both (1) Active Directory users authenticated using Windows Authentication, and (2) Active Directory users, existing in another distinct OU, authenticated via ADFS (active
    directory federation services).
    My problem is with the ADFS users. I want to have the users unique id be their logon email account ([email protected]), but want to populate their work email attribute with their "actual" or real email account.
    If I have an OU (External Users) and within that OU (XYZ Company Users), AND my domain is contoso.com, then I want to add a user such that they have a unique id in active directory ([email protected], but want their email address to be whatever
    it is (I.e. [email protected]).
    MY PROBLEM: I can setup the User Profile Synchronization service to map the properties perfectly, but when I I try to add/share a user in a SharePoint site, the user's account email ([email protected] is sent the message, not their "Work Email"
    ([email protected]).
    QUESTION: How do I get SharePoint to use the "Work Email" attribute (NOT the account email) of a User Profile when sending email messages?

    Okay, within Active Directory, the user's email IS set to
    [email protected] The "unique value" (Using the account logon name) works just fine. The problem is SharePoint. When I logon with another account and choose to share a site with this particular test user, the Email for sharing the site is sent to
    [email protected] (the account logon name), not
    [email protected] (the user's email address)
    How do I get SharePoint to actually use the email address of an AD user, and not use the account logon name when sending notifications?

  • Validation for 2 attributes in a single expression

    Hi All,
    I have a scenario such that I need to make 2 attributes as mandatory when I chose a particular
    Category node.
    Now I am able to write, execute validation for one attribute but when I write for 2 attributes, only the first
    attribute is being considered. Even if the second attribtue is not present, it says there are no errors.
    Regards,
    Pramod

    Hi Pramod,
    I have tried this thing at my side and its working fine.
    Please check the steps below:
    1. Create new validation and dont write any thing in the expression.
    2. Add a branch to this validation and select the node which you want to validate.
    3. Inside the branch expression just write IS_NOT_NULL(Attribute1) AND IS_NOT_NULL(Attribute2)
    select Attribute1 and Attribute2 from the Attributes list.
    4. Run the Validation.
    Regards,
    Jitesh Talreja

  • Patterns for attribute in a schema?

    How do you set the patterns value for an attribute in a schema file?

    The XML representation for a pattern schema component is a pattern element information item. The correspondences between the properties of the information item and properties of the component are as follows:
    XML Representation Summary: pattern Element Information Item
    <pattern
    id = ID
    value = string
    fixed = boolean : false
    {any attributes with non-schema namespace. . .}>
    Content: (annotation?)
    </pattern>

  • Attribute validation error for tag CFQUERY

    I have a CF application that's running fine on a shared host. I now have a VPS running version of CF 9. When I try to use this on the VPS, I get the following error:
    Attribute validation error for tag CFQUERY.
    The value of the attribute datasource, which is currently '', is invalid.
    The datasource is being set in application.cfc, and again works just fine in the shared environment.
    The only differences is the shared is running on Windows, and the VPS is Linux. Also, the Windows is running version 9,0,1,274733 and the Linux is 9,0,0,251028
    Any help would be greatly appreciated.

    bbholdem wrote:
    I have a CF application that's running fine on a shared host. I now have a VPS running version of CF 9. When I try to use this on the VPS, I get the following error:
    Attribute validation error for tag CFQUERY.
    The value of the attribute datasource, which is currently '', is invalid.
    The cause of the error is obvious. Somewhere in your application, the cfquery tag is used as follows, with an empty string as datasource:
    <cfquery datasource="">
    </cfquery>
    That is a mistake. The error message should tell you where that occurs.

  • How can I use database constraints in entity attribute validation rules

    I am interested in using database constraints to validate attributes in entity objects.
    I would like to implement a JboValidatorInterface in a way that I can use an operator like "GreaterOrEqualTo" to compare with values retrieved from the database for a column associated with an entity object attribute.
    I have used this pattern with success in other environments, where the user community decides the minimum value for a thing should change from x to y, and simply changing a database object also changes the validation methods of all applications which access it.
    I am not certain that column constraints are the appropriate vehicle, but so far that seems to be the case.
    I see that you can create a validation rule which makes comparisons against a view object attribute. I am wondering if there is a generic way to use standardized names for column constraints along with ADF hooks into properties of database columns, to avoid writing individual queries for each attribute.
    Thanks in advance!!!

    Jeffrey,
    If you already have constraints on the underlying tables, why do you need to validate them in ADF BC? You can certainly use some framework extension classes to give the user nicely formatted error messages - see ER: ADF BC - allow custom error msgs for common exceptions (e.g. DML) for more details.
    I am using this method so that anything that is enforced in the database (check constraints, foreign keys, unique constraints, etc) are not enforced in the ADF BC layer as well - after all, there's more than one way to get data into a table, and DB constraints ensure that even if data gets in through another mechanism (apart from the ADF application), it is valid. My 2 cents, of course.
    Hope this helps,
    John

  • TREX python extension for HTML attribute extraction

    How is the TREX python extension for HTML attribute extraction supposed to work?
    I activated this extension and indexed an HTML document containing:
    <HTML>
    <HEAD>
    <META content="debian, GNU, linux, unix" name=Keywords>
    <HEAD>
    <HTML>
    Why when submitting the query "unix" this document is not found by the system?
    (TREX version 6.1.11.02)
    Davide

    The trick doesn't work on my system (TREX v. 6.1.11.02).
    1) This is the edited line in getDCAttributes.py:
    knownAttributes = ['description','Keywords']
    2) Only the HTML Attribute Extractor extension is activated in extensions.py. In particular, the Dublin Core extension is deactivated.
    3) This is the pythonextension section of TREXPreprocessor.ini:
    extensiontype= beforeHTTP
    4) This is the parametrization of the newly created property in CM:
    <i>Unique ID: html_keywords
    Description: not set
    Property ID: Keywords
    Namespace Alias: trilog
    Type: String
    Group: html
    Mandatory: not checked
    Multi-Valued: not checked
    Read Only: not checked
    Maintainable: not checked
    Indexable: checked
    Default Value: not set     
    Allowed Values: not set
    Key for Label: not set
    Meta Data Extension: not set
    Folder Validity Patterns: /
    Document Validity Patterns: /
    Resource Types: not set
    Mime Types: not set
    Default Sorting     Ascending: not set
    Label Icon: not set     
    Hidden: not checked
    Dependencies: not checked
    Additional Metadata: not set
    Property Renderer: not set
    Virtual: not checked
    Composed of: not set
    Comparator Class: not set</i>
    5) I've added this property in the parameters <i>Allowed Predefined Properties</i> and <i>Predefined Properties</i> under <i>Content Management -> User Interface -> Search</i>
    6) Now it's possible to filter by the <b>Keywords</b> predefined property in the Search UI, but no matches are ever found.
    7) No significant message is found in PythonExtension.log:
    # running global extensions.py at Tue Jul 12 11:13:03 2005
    ### import getHtmlAttributes
    # running global extensions.py at Tue Jul 12 11:13:04 2005
    ### import getHtmlAttributes
    8) I've run another test <b>activating the Dublin Core extension</b> in extensions.py as well, and setting extensiontype to beforeLEXICON in TREXPreprocessor.ini. Nevertheless it didn't work.
    9) Here's some DC extension's output:
    ### Parse document with key: '/davide_test/attributi/GNU_Emacs.htm'
    ### extracted attributes: []
    This is the GNU_Emacs.htm's <head>:
    <META content=emacs name=keywords>
    Cheers, Davide

  • CVP Opsconsole: Patterns for RNA timeout on outbound SIP calls - Dialed Number (DN) text box does not take any input

    Hi there,
    I'm having problems modifying the 'Dialed Number (DN)' text box under 'Advanced Configuration->Patterns for RNA timeout on outbound SIP calls' of the SIP tab in the Cisco Unified Customer Voice Portal 8.5(1) opsconsole. In a nut shell, I need to change the RNA timeout but some reason when typing into the Dialed Number text box, the input is not taken. The reason I want to change this settings is because my ICM Rona is not working with CVP:
    https://supportforums.cisco.com/thread/2031366
    Thanks in advance for any help.
    Carlos A Trivino
    [email protected]

    Hello Dale,
    CVP doesn't allow you to exceed the RNA more than 60  Seconds. If you want to configure the timer for DN Patterns you should  do it via OPS console, It would update the sip.properties files in  correct way, the above way is incorrect.
    Regards,
    Senthil

  • Could not find schema information for the attribute 'filename'

    Can anyone help me.
    I download the VB.NET sample source and try to run the application and got this error.
    "Could not find schema information for the attribute 'filename'"
    and
    "Could not find schema information for the attribute 'url'"
    and
    "Custom tool warning:Schema validation warning:Schema item 'element' named 'AccountWS_AccountUpate_Input' from namespace 'urn:crmondemand/ws/account/' is invalid. Namespace 'urn:/crmondemand/xml/account' is not available to be referenced in this schema"
    Thanks
    Pitiporn

    Are these errors or warnings? If warnings, you should be able to just ignore them.

Maybe you are looking for

  • Google browser preference being usurped by trovi; need to eradicate.

    Browsers: Google and Safari were usurped by Ask, both resolved by Apple Support. However, Apple unable to resolve similar issue with Firefox being usurped by trovi. On opening Firefox browser 1st page shows google but on opening further tabs, trovi h

  • Built-in isight white light on right

    Hi, I have a MacBook model 5,1, and the isight stop working months ago. I think I have gone through all the troble-shooting steps it still does not show up in system profiler but about two days ago it worked once when I plugged in a camera via a USB

  • How to create campaign Wiki

    Hi, Can anyone help me to understand whats is campaign Wiki and how to use it. Any sort of tutorial will be very much helpful Thanks, Abhijit

  • Cache communication Error

    Hi, I am using two applications in two App servers A and B using App server JMS for cache synchronization. I have the JMS topic set up in App server A. Both the applications use this Topic for cache synchronization. Cache synchronization works fine f

  • How re-install xcode 4.1 from AppStore

    While I was installing xcode an alert was launched to notified me to close iTune application. Even if iTune got closed the alert window did not disappear. Since the installation did not run, after a long time I need to force the close of installation