A special character validation using regular expressions in ADF

Hi guys,.

I want to put the validation of a special as character (,.') ((en) &, -) using regular expressions.

I asked the posting as [a-zA-Z0-9'(.),--/ &] but it does not work properly.

Special characters should be like:

Comma,

Hyfan-

Dot.

Open and close braces (and).

Ampercent &

Apastrophy '

Space ""

Please help if anyone has idea.

And I also tried to put under expression as...

[a-zA-Z] + (\\s* [0-9] * [a-zA-Z] *-* & * \\(*\\) *, *'*. *) * [a-zA-Z0-9] + but we need the validation if we put special characters between the charater as "ab," chain "& (bc).

his does not work if I put a special character at the beginning and the end of the string in the ADF

Thanks Timo...

its working fine...

Tags: Java

Similar Questions

  • ADF Email of Validation using regular expressions

    Hello

    Wanted to add search Email Validation VO.

    It works if I put
    <af:validateRegExp pattern="[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}" 
                                             messageDetailNoMatch="The value {1} is not a valid email address:"/>
    However, this requires identification of email to be entered in capital letters.

    I tried with below the option does not work.
                   <af:inputText value="#{bindings.xxEmail.inputValue}" label="Email"
                                          required="#{bindings.xxEmail.hints.mandatory}"
                                          columns="#{bindings.xxEmail.hints.displayWidth}"
                                          maximumLength="#{bindings.xxEmail.hints.precision}"
                                          shortDesc="#{bindings.xxEmail.hints.tooltip}" id="it5">
                                <f:validator binding="#{bindings.xxEmail.validator}"/>
                                <f:validateLength minimum="6"/>              
                                <af:validateRegExp pattern="[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}" 
                                             messageDetailNoMatch="The value {1} is not a valid email address:"/>
                            </af:inputText>
    I got over information of
    ADF Email of Validation using regular expressions
    The user enter email id without @.



    Please suggest this model to reach.


    Thank you
    JIT

    Published by: appsjit on January 25, 2013 19:08

    Hello.
    My English is not very good.

    I use below format and it works


    "^ [_A-Za-z0 - 9-] + (\.). [_A-Za-z0-9-]+)*@[A-Za-z0-9][A-Za-z0-9-]+ (-.)] ([A Za-z0-9] +) * (-.) [A-Za - z] {2,}) $»
    messageDetailNoMatch = "the value {1} is not a valid email address" / >

    Habib

    Published by: Habib Eslami on January 26, 2013 01:22

  • Validation using regular expressions or oracle fn

    Hello

    I want to apply validation to a column. I'm trying to see if I can use the regexp_replace function to find a boss and see if I can replace it to a better format. Can someone help me with these rules?

    1. only the characters a - z, A - Z, 0-9, ', - is allowed. If there are no other characters, then these characters must be removed.

    2. name should not begin with a symbol.

    3. If there is any symbol permitted in the name, (for example the hyphen) then the hyphen should be preceded and followed by a space.

    I would like to know if the above can be obtained by regular expressions or any other function will be useful to achieve the same.


    Thank you very much

    Cherkaoui

    HI, Charan,

    Whenever you have a problem, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) of all the tables involved, so that people who want to help you can recreate the problem and test their ideas.

    Also post the exact results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.  Post in this case, maybe 5 or 10 strings, and what you would like to see (a string corrected, or a 'yes' / 'No' flag saying if this string follows rules.)

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

    2784427 wrote:

    Hello

    I want to apply validation to a column. I'm trying to see if I can use the regexp_replace function to find a boss and see if I can replace it to a better format. Can someone help me with these rules?

    1. only the characters a - z, A - Z, 0-9, ', - is allowed. If there are no other characters, then these characters must be removed.

    2. name should not begin with a symbol.

    3. If there is any symbol permitted in the name, (for example the hyphen) then the hyphen should be preceded and followed by a space.

    I would like to know if the above can be obtained by regular expressions or any other function will be useful to achieve the same.

    Thank you very much

    Cherkaoui

    Sorry, we don't know what you want to do.

    1 seems to mean you want to change the given string so that it follows the rules.  (What exactly are special characters?  Are there only 2 special characters: single quotation mark and hyphen?)

    2 seems to tell us that you want to check if it meets the rules

    3. can be a

    I'll assume that you want to modify the string so that the returned value corresponds to rules.  This means that if the given string violates, 2 symbols will be removed from the beginning of the string, and if it violates 3, then spaces will be added.

    I don't think that there is a way to do this with a regular expression.

    You can make each with a separate REGEXP_REPLACE corrections, and make all in the same query by one nesting inside each other, like this:

    SELECT REGEXP_REPLACE (REGEXP_REPLACE (REGEXP_REPLACE (: str)))

    , "[^ a-zA-Z0-9 cm-]"

    )

    , '^[''-]+'

    )

    , ' *([''-]) *'

    , ' \1 '

    ) AS new_str

    OF the double

    ;

    of course, I can't test it, until post you some sample data and the exact results you want from these data.

    Here, the inner REGEXP_REPLACE rule 1 applies.  It deletes all characters except a to z small letters, capital letters A to Z, numbers, spaces, single quotes and hyphens.

    Rule 2 applies the REGEXP_REPLACE middle.  It removes the single quotes and hyphens that appear at the beginning of the string.

    The external REGEXP_REPLACE rule 3.  It guarantees that each single quotation mark or a hyphen is preceded and followed by a space.  If there is already a space (or several spaces) before and/or after the special symbol, they are replaced by a single space.  If this isn't what you want, it can be fixed, but it will make the expression even messier.

    You might consider to write a user-defined function to normalize strings.  In a function procedure, you can apply the rules one after the other. you need not nesting complicated like that.  Of course, a user-defined function will be slower, but maybe it's not a problem.

    Still, the above query converts the string so that the production rules.

    If you just want to check whether a string conforms to the rules, you can compare the original string to the output of the above expression.  If they are identical, then the string is in accordance with the rules.

  • Chips with 3 delimiter characters using regular expressions

    Hello world

    I have a function that is able to mark the input in a collection string using regular expressions.

    In case the input string is a character such as the comma or semicolon delimiter,

    We can just get the result we want like the example below.

    SQL> select * from v$version;
    
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    

    SQL> with tab1 as (
      2      select 'abc,dfg,h,,1234' as col1 from dual
      3  )
      4  select regexp_substr(col1, '([^,]*)(,|$)', 1, level, 'i', 1) as result
      5  from tab1
      6  connect by level <= regexp_count(col1, ',')+1;
    
    
    RESULT
    ---------------
    abc
    dfg
    h
    
    1234
    

    But in the case where the channel of entry has 2 types of delimiter and each delimiter consists of 3 characters as below

    I wonder if it is possible to get the result as below.

    The input string: 01| ^ | ABCD| ^ | 111| * | 02| ^ | efgh| ^ | 222

    Separators: | * | is divided into lines, | ^ | is divided into columns

    Expected result:

    col1 col2 col3

    Row1 - > 01 abcd 111

    row2-> efgh 02 222

    Simply put, take a next

    The input string: 01| ^ | ABCD |^| 111 |*| 02 |^| efgh |^| 222

    Separator: | * |

    Result:

    01. ^ | ABCD | ^ | 111

    02. ^ | efgh | ^ | 222

    How can I achieve this using regular expressions?

    Kind regards

    Euntaek

    You need to know the number of the column from the outset:

    with tab1 as)

    Select ' 01 | ^ | ABCD | ^ | 111. * | 02. ^ | efgh | ^ | 222' as double col1

    )

    Select rownum,

    regexp_substr (regexp_substr (col1 '(.*?) ((\|\*\|)| $) ', 1, level, null, 1),'(.*?) ((\|\^\|)| $) ', 1, 1, null, 1) col1,.

    regexp_substr (regexp_substr (col1 '(.*?) ((\|\*\|)| $) ', 1, level, null, 1),'(.*?) ((\|\^\|)| $) ', 1, 2, null, 1) col2.

    regexp_substr (regexp_substr (col1 '(.*?) ((\|\*\|)| $) ', 1, level, null, 1),'(.*?) ((\|\^\|)| $) ', 1, 3, null, 1) col3

    of tab1

    connect by level<= regexp_count(col1,'\|\*\|')="" +="">

    /

    ROWNUM COL1 COL2 COL3

    ---------- ----- ----- -----

    1 01 abcd 111

    2 efgh 02 222

    SQL >

    SY.

  • validate cfinput using regular expressions

    Hello

    can someone help me valditing a field of cfinput using regular expressions?

    First digit must be a number or a 'R '.

    Figure 2-15 can be anything without special characters. Figure 2-15 can also be empty.

    I try this, but it does not work (sorry I'm a beginner using regex).

    < cfinput type = "text" name = "field1" required = "yes" validate = 'regular_expression' pattern = "[0 - 9Rr] [0 - 9a - zA - Z]" * "maxlength ="15">"

    Thank you for advice!

    Claudia

    ^ [0 - 9Rr]([0-9a-zA-Z]{1,14})? $

  • Validation with Regular Expressions

    I am validating data using regular expressions.
    Here is a copy of the code.

    < cfinput type = "text" name = "FQID_ #ATTRIBUTES. "FQID #_officer" width = "36" validate = 'regular_expression' pattern = "^ \bna\b$ |" ^ \d * [0-9](|. \d*[0-9]|,\d*[0-9])?$» required="#ATTRIBUTES.required#» activé = «Oui» message = «0,0 à 100 ou na, requis» value = «#ATTRIBUTES.) "FQID_Response.Officer #" style = "textAlign:right"; onchange = "removeDash (FQID_ #ATTRIBUTES. FQID #_officer); "/ >

    I don't get any errors, but I'm still able to I want to enter in the text box. I try to limit to a number between 0 and 100 and excludes the decimal amount. It must also accept na if not applicable. As it is now, I can enter anything.

    Thanks, that explains it.

  • How to extract the value of a tag XML using regular Expressions

    We get a response XML from a WEB SERVICE.

    I convert it to VARCHAR2.

    Now, I want to get the real answer that is inside the tag of the response.

    I tried this:

    DECLARE

    V_1 VARCHAR2 (30000): = ' < soap: Body > < ns:ProcessArgusFeedsResponse xmlns:ns = "urn: PegaRULES:SOAP:ArgusToPegaFeeds:Services" > ' |

    '< response > good < / answer >< / ns:ProcessArgusFeedsResponse > < / soap: Body > ';

    v_response VARCHAR2 (100);

    BEGIN

    DBMS_OUTPUT. PUT_LINE (V_1);

    v_response: = REGEXP_SUBSTR (v_1, ' / < >(.+?) < \/Response > answer /');

    dbms_output.put_line (v_response);

    END;

    It does not work.

    Any help would be greatly appreicated.

    Hello

    user12240205 wrote:

    We get a response XML from a WEB SERVICE.

    I convert it to VARCHAR2.

    Why?  XML has its own native ways of analysis; Why not use them?

    If you use regular expressions, then REGEXP_REPLACE, as shown above, is a good option in Oracle 10, but starting in Oracle 11.1, you can use REGEXP_SUBSTR like this:

    REGEXP_SUBSTR (v_1

    , '(.+?)'

    1

    1

    NULL

    1

    )

    The 6th argument is like a backreference; "He tells REGEXP_SUBSTR did not return to the entire organization, but only the part inside the 1st left '(' et correspondant à sa droite).

    The '?' to make it non-greedy is necessary only if v_1 can contain more than one response.

    Now, I want to get the real answer that is inside the tag of the response.

    I tried this:

    DECLARE

    V_1 VARCHAR2 (30000): = "" |

    'Good';

    v_response VARCHAR2 (100);

    BEGIN

    DBMS_OUTPUT. PUT_LINE (V_1);

    v_response: = REGEXP_SUBSTR (v_1, ' /(. +?)) <\ esponse="">/');

    dbms_output.put_line (v_response);

    END;

    It does not work.

    That's because it's looking for a slash ("/") before the '' tag and another after the ' tag.

    The backslash ("\") is not necessary here, but it is not nothing wrong.

  • Find the words (wild cards) using regular expressions

    I'm testing to see if the words are present for revision 1 of a drawing of the cartridge.

    The script search the digit 1 followed by a date, a title, and 4 sets of initials.

    The number 1 is static, (date, title and original are the cards that they are different for each design).

    I use regular expressions to match the words.

    The regular expression highlighted in blue is the number 1 and the date.

    Him remains highlighted in orange does not match the title and initials.

    If anyone can help with the regular expression that is most appreciated.

    Once I got that work will add the form fields for the initials, noting only the console at this point for the tests.

    numWords = this.getPageNumWords (0);

    number of words on the page

    loop through the words on the page

    for (var j = 0; j < numWords-1; j ++)

    {/ / get the pair of words to test}

    ckWords = this.getPageNthWord (0, j) + ' ' + this.getPageNthWord (0, j + 1); test words

    Check if 1 26.05.16 THE STRENGTHENING REVISED MM SB AE GM word string is present

    If (ckWords.match(/ ^ 1\s [0-9] {1,2}.)) [0-9] {1,2}. [0-9] {2} \s\w+(\s+\w+){1,7}/))

    {

    Console.println (ckWords);

    }

    }

    You can use something like this:

    ckWords = this.getPageNthWord (0, j) + ' ' + this.getPageNthWord (j, 0, + 1) + ' ' + this.getPageNthWord (0, + 2 j) + ' ' + this.getPageNthWord (0, j + 3) + ' ' + this.getPageNthWord (0, j + 4) + ' ' + this.getPageNthWord (0, j + 5) + ' ' + this.getPageNthWord (0, j + 6);

    If (! ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} \.\d {2} \s\w+ (?:-s + \w +) {1.8} \s([A-Z]{2})\s([A-Z]{2})-s ([A - Z] {2}) \s([A-Z]{2})$ /)) ckWords + ckWords + "" + this.getPageNthWord (0, j + 7);

    If (! ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} \.\d {2} \s\w+ (?:-s + \w +) {1.8} \s([A-Z]{2})\s([A-Z]{2})-s ([A - Z] {2}) \s([A-Z]{2})$ /)) ckWords + ckWords + "" + this.getPageNthWord (0, j + 8);

    If (ckWords.match (/ ^ 1\s\d {1,2} \.\d {1,2} {2} \s\w+ \.\d (?:-s + \w +) 1.8 ([A - Z] {2}) \s([A-Z]{2})\s([A-Z]{2})\s {} \s([A-Z]{2})$ /))

    {

    ...

  • String format using regular expressions

    Input string output format...
    
    SELECT q'<select ab_c "ABC", efg "EFG" from dual>' str FROM DUAL
    
    Output:
    
    STR                                  
    -------------------------------------
    select ab_c "ABC", efg "EFG" from dual
    
    
    Required output format using regular expression...
    
    
    STR                                  
    -------------------------------------
    select 'ab_c' "ABC", 'efg' "EFG" from dual

    Regular expressions have many limitations as tools of analysis, and you specify the rules you want. This expression puts quotation marks around a non-empty string before a quoted string:

    SELECT regexp_replace(q'