How i can validate a entered text against regular expressions ?

Thank you for reading my post.
how i can validate an entered text to checkk its syntax to ensure that it is a domain name ?
I think i should use RE , but i do not know how i can do this.
Thank you

If you want to validate at client side, you need to create a javascript function (validation) and add it to the "onBlur" attribute of the TextField component In the propertysheet (Set it via JavaScrip->onBlur in the property sheet). To put the Actual Java Script, you need to edit the JSP page. If you need to do it server side, create a custom validator.
http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/customvalidator.html
- WInston
http://blogs.sun.com/winston

Similar Messages

  • Validate user-entered text in JTable

    How do I validate user entered text in JTable cell, so only the values 1234567890. are acceptet? The cell should contain only doubles....

    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class aslan extends JFrame {
      public aslan() {
        TableModel model = new CustomTableModel();
        JTable table = new JTable(model);
        getContentPane().add(new JScrollPane(table), "Center");
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(300,200);
        setLocation(300,300);
        setVisible(true);
      private class CustomTableModel extends AbstractTableModel {
        String[] headings = new String[] {
          "Cost", "Item", "Type"
        Object[][] data = new Object[][] {
          { new Double(12.75), "glue",   "tube" },
          { new Double(15.20), "hammer", "claw" },
          { new Double(8.32),  "saw",    "hack" }
        public int getRowCount() {
          return data.length;
        public int getColumnCount() {
          return data[0].length;
        public Object getValueAt(int row, int column) {
          return data[row][column];
        public void setValueAt(Object value, int row, int column) {
          data[row][column] = value;
          fireTableDataChanged();
        public String getColumnName(int column) {
          return headings[column];
        public Class getColumnClass(int column) {
          return data[0][column].getClass();
        public boolean isCellEditable(int row, int column) {
          return true;
      public static void main(String[] args) {
        new aslan();
    }

  • How user can get a Sales Text for the any Line Item in the Billing?

    Salute Masters ! !
    How user can get a Sales Text for the any Line Item in the Billing?
    It's coming for other Order (Line Item for Bought out Item at Project Site - Some Item they procure at project site & complete the task).
    Where I can configure in system for all.
    Rgds
    Srivastav
    09973504950

    Hi,
    Sales text can be copied from customer to order , order to delivery and delivery to billing .
    Check the T-code : VOTXN , do the customization as per your requirement.
    check the below link :
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/dd/55f993545a11d1a7020000e829fd11/content.htm

  • HOW WE CAN VALIDATE A FIELD THAT SHOULD NOT BE SPECIAL CHARACTER?

    HOW WE CAN VALIDATE A FIELD THAT SHOULD NOT BE SPECIAL CHARACTER?

    data : v_abcde like sy-abcde,
             v_num like '0123456789',
              v_data(60) type c.
    start-of-selection.
    v_abcde = sy-abcde.
    concatenate v_abcde v_num into v_data.
    if ur field co v_data
    else.
    message.
    endif.

  • Hi, how/where can I file a complain against one premium re-seller here in the philippines?

    hi, how/where can I file a complaint against one premium re-seller here in the philippines?
    I was really ****** off on how they mishandled my warranty problem, they really wasted a lot of my time.

    You can try calling the Phillipines support number:
    http://support.apple.com/kb/HE57
    and asking to speak with someone on Customer Relations. If you haven't discussed the issue with the owner or manager of the reseller, though, start there first.
    Regards.

  • Find text using regular expression and add highlight annotation

    Hi Friends
                       Is it possible to find text using regular expression and add highlight annotation using plugin

    A plugin can use the PDWordFinder to get a list of the words on a page, and their location. That's all that the API offers for searching. Of course, you can use a regular expression library to work with that word list.

  • HT3705 how i can solve format behind text troubleshoot?

    when im goin to move a picture, i go to format objects, and then select layout, then i select behind text and press ok... and this message is pop up:
    "the serve application,souce file, or item cannot be found. make sure the application is properly installed, and that it has not been deleted, moved, or removed"
    what i may do?

    Where do you go to format objects? In the menu? Where do you select layout? Nor can I find "behind text". Could you describe what you do with the wording that is in Pages?

  • How to include a forward slash(/) in my regular expression

    Hai All,
    I am having a regular expression which should accept only A-Z, 0-9, (underscore) and .(period) .
    <property name="patterns" value="[A-Z0-9\\._]*" />
    Now i need to add /(Forward slash) to this expression.
    <property name="patterns" value="[A-Z0-9\\._/]" />
    But when i add it it is accepting both Foward slash and Backward slash.
    Can someone guide me such that it accepts only A-Z, 0-9, Underscore, period and a Forward slash(/).
    Thx in advance..

    Looks like you had it right to me.
    import java.util.regex.Pattern;
    import junit.framework.TestCase;
    public class RegexTest extends TestCase{
         public String patternString = "[A-Z0-9\\./]*";
         public void testRegex(){
              Pattern pattern = Pattern.compile(patternString);
              assertTrue(Pattern.matches(patternString, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"));
              assertFalse(Pattern.matches(patternString, "abc"));
              assertTrue(Pattern.matches(patternString, "24.7"));
              assertTrue(Pattern.matches(patternString, "24/7"));
              assertFalse(Pattern.matches(patternString, "21\\7"));
    }It works in my tests.
    What happends to this "patterns" property? Where and how are you using it?

  • How I can save report (graphics & text) in PDF format in LV6i?

    I am new to LabView. I tried to save the report as HTML document, it works well using vi's from report generation pallet. But the problem is HTML stores graphic images and text as multiple files. My requirement is to have one single file (like PDF format) to store the results/report of the process.
    Any help in this problem will be greatly appreciated.

    MattI wrote in message news:<[email protected]>...
    > Actually, this is really easy.
    >
    > Just open the .html file from within Word, and then save it as a Word
    > file.
    >
    > After this, if you have Adobe Acrobat installed, you can create a pdf
    > of the Word file.
    You could write a batch file that prints to a PS file using a PS
    Printer driver and then runs GhostScript to automate the PS -> PDF
    conversion. There is no need to buy a MS or Adobe product.
    A big of searchign and you'll probably find some ghostscript addon for
    HTLM->PS->PDF conversion

  • Find text by regular expression

    I'm struggling with a problem. I have some files that contain a string like:
    "name": "someName"
    I can find these using egrep like so:
    egrep -r '"name": "[^"]*"' /some/folder/path/
    This works admirably, except that it returns more than I really want. It gives me something like this:
    /path/to/Chrome/extension/manifest.json:   "name": "Extension Name"
    What I really want is just the name itself, eg:
    Extension Name
    I don't care about anything else. I'm running these searches from an AppleScript, which already knows what folder it's looking in, and just needs to know 1) if a match was found, and if so, 2) what the name was.
    How can I do this? Is there a way to do a search that only returns a particular portion of the results, or would I need to run the results through something else to filter it further?
    Thanks in advance!

    MrHoffman wrote:
    If I've guessed correctly at what you're doing
    Heh... I imagine you have. I wasn't sure who might frequent this forum, so didn't want to make any assumptions.
    You may or may not know that I have an EtreCheck-like script that I use in conjunction with my Adware Removal Tool. It has proven to be extremely helpful in locating new adware, but it still somewhat limited in getting information on Firefox and Chrome extensions. It has proven difficult to get names, especially for Chrome extensions. I'm working hard on trying to improve it.
    An excerpt from a sample manifest.json file in a Chrome extension - modified slightly for clarity - looks like this:
       "manifest_version": 2,
       "name": "Some extension name",
       "offline_enabled": true,
       "version": "6.3"
    I'm using egrep to search for this "name" key so that I don't have to make too many assumptions about the internal structure of the extension folder. I know the manifest.json file is in there somewhere, and will have this key in it, so this is an easy way to find that name. To just display the name, the simple egrep I'm using is adequate, but in some cases there's special data in that name string that indicates where to find a localized name, so I need to be able to do something special in those cases, and need just the name string and nothing else.
    The solution turns out to be a combination of several responses. The addition of the -o and -h flags gets me close to what I want, and passing it through cut with a double-quote as the delimiter works to trim it down perfectly. So now I can do:
    egrep -roh '"name": "([^"]*)"' /path/to/folder/ | cut -d \" -f 4
    The egrep will return:
    "name": "Some extension name"
    Passing it through cut with the above parameters gives exactly what I need... just:
    Some extension name
    Thanks to all for the advice!

  • How to split a string with a delimiting regular expression like "\r"

    Hello!I am a fresh in java programming.Please don't deride my question.What I want to realize is to get the current caret lines and cols in a JTextPane. My question is :After I fetch the string content of the JTextPane and try to split it with the end-line token like "\r" or "\r\n",it always comes me an wrong position.
    here is my code:
    public void caretUpdate(CaretEvent e) {
    int ln,col;
    JTextPane textSource = (JTextPane)e.getSource();
    String sourceString = textSource.getText();
    String subString = sourceString.substring(0,
         (e.getDot() == 0) ? 0 : e.getDot()-1);
    String[] splitString = subString.split("\r",-1);
    ln = splitString.length;
    col = e.getDot() - subString.lastIndexOf("\r");
    setCaretPosition(ln,col); //display ln and col in a label
    I have got puzzled>_<.Please help me.Any help would be appreciated . (^-^)

    Swing text components always use "\n" to separate lines, not "\r" or "\r\n". When you read text in from a file or paste from the clipboard, the line separators are converted to "\n" if necessary. They save the info about what line separators were used in the source file, so if you write the text back to a file it converts them back.

  • How to improve performence of the procedure using regular expressions

    Hi all,
    I have used substr, instr functions in this procedure .
    Kindly tell me how use regular_expressions in this procedure .
    /* Formatted on 2011/07/20 17:18 (Formatter Plus v4.8.8) */
    PROCEDURE pr_insrt_prcdr_rvne_edit ( --ver 4.4
    p_pa_rqst_sid IN NUMBER,
    p_err_code OUT NUMBER,
    p_err_msg OUT VARCHAR2
    IS
    v_count NUMBER;
    CURSOR error_dtls
    IS
    SELECT parent_target_table_sid, inbnd_target_table_cid,
    target_table_sid
    FROM inbnd_278_error
    WHERE parent_target_table_sid = p_pa_rqst_sid
    AND SUBSTR (error_data_value, INSTR (error_data_value, ':') + 1) IN
    ('5056', '5031');
    CURSOR error_values (
    p_target_table_sid inbnd_278_error.target_table_sid%TYPE
    IS
    SELECT MAX (DECODE (SUBSTR (error_data_value,
    INSTR (error_data_value, ':', 1) + 1
    '5056', SUBSTR (error_data_value,
    1,
    INSTR (error_data_value, ':', 1) - 1
    ) AS e5056,
    MAX (DECODE (SUBSTR (error_data_value,
    INSTR (error_data_value, ':', 1) + 1
    '5031', SUBSTR (error_data_value,
    1,
    INSTR (error_data_value, ':', 1) - 1
    ) AS e5031
    FROM inbnd_278_error
    WHERE target_table_sid = p_target_table_sid
    AND SUBSTR (error_data_value, INSTR (error_data_value, ':', 1) + 1) IN
    ('5056', '5031');
    v_error_values error_values%ROWTYPE;
    BEGIN
    p_err_code := 0;
    p_err_msg := 'Success';
    FOR curr_error_dtls_rec IN error_dtls
    LOOP
    OPEN error_values (curr_error_dtls_rec.target_table_sid);
    FETCH error_values
    INTO v_error_values;
    IF (v_error_values.e5056 IS NOT NULL
    AND v_error_values.e5031 IS NOT NULL
    THEN
    DELETE FROM inbnd_278_error
    WHERE SUBSTR (error_data_value,
    INSTR (error_data_value, ':') + 1
    ) IN ('5056', '5031')
    AND target_table_sid = curr_error_dtls_rec.target_table_sid
    AND inbnd_target_table_cid = 109;
    INSERT INTO inbnd_278_error
    (inbnd_278_error_sid,
    parent_target_table_sid, inbnd_target_table_cid,
    target_table_sid, meta_data_cid,
    error_data_value,
    created_by, created_date
    VALUES (inbnd_278_error_seq.NEXTVAL,
    curr_error_dtls_rec.parent_target_table_sid, 109,
    curr_error_dtls_rec.target_table_sid, 161,
    v_error_values.e5056
    || ','
    || v_error_values.e5031
    || ':'
    || '5059',
    1, SYSDATE
    END IF;
    CLOSE error_values;
    END LOOP;
    EXCEPTION
    WHEN OTHERS
    THEN
    p_err_code := SQLCODE;
    p_err_msg :=
    'Error occured in pr_insrt_prcdr_rvne_edit procedure '
    || SUBSTR (SQLERRM, 1, 100);
    END pr_insrt_prcdr_rvne_edit;
    Thanks,
    P Prakash
    Edited by: prakash on Jul 20, 2011 4:48 AM

    Yes as explained in the forum FAQ which you should read
    http://forums.oracle.com/forums/ann.jspa?annID=1535
    *2. How do I ask a question on the forums?*
    SQL and PL/SQL FAQ
    And the section beginning.
    *9) Formatting with {noformat}{noformat} Tags*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Is it possible, I can validate the notification response

    Hi,
    Is it possible, we can force a user to enter a value before approving the notification . Because one of our workflow process required a value from the approver. This notification contains 3 responses ( 1 Approve, 2 Partially Approve, 3 Reject). In the case of partially approve I want partially approved amount from the approver.
    How I can validate amount entered or not, before clicking the partially approved response button in the workflow notification.
    With Regards
    Satheesh Kumar

    Hi,
    You can derive the button by looking at the response from the notification. the WF_ENGINE.CONTEXT_NID variable will tell you the notification ID that is being responded to, and you can derive the response from there:
    v_response := wf_notification.GetAttrText(wf_engine.context_nid,'RESULT');
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • How can I export formatted text from a string indicator?

    Does someone know how I can export formatted text (i.e., parts of the text have different formatting, such as color, fontsize, etc.) from a string indicator? Using copy/paste does not work, as it only exports unformatted plain text.

    Hello Sparti,
        Thank you for your suggestions, they are all very useful, and I plan to use the HTML feature under Report Generation to export the formatted text from Labview. However, I am still not sure how I can extract the formatted text from a *string indicator* and transfer it to one of those VIs, so that it can be exported to other applications. Let me give some more specific info on what I am trying to achieve:  I am monitoring the communication between two pieces of equipment. A string indicator shows all the data flow, with different colors for data coming from different instruments. I managed to do that by using a property node and playing with the selection and font color properties. Now, if you just wire the output of the string indicator, the formatting is gone and all you get is just plain black text (for instance, try to programmatically transfer the formatted text from one string indicator to a different string indicator and you will see that the formatting is not preserved). Even if you try the "brute force" method of manually selecting and copying the text in the indicator and pasting it to Word, LV does not export the formatting. But, if you paste *within*  LV (for example, paste it to a string constant in your diagram), then it works. To extract the formatted string from the indicator, I also tried to use a property node, but without success. I am trying to avoid duplicating part of my code to generate the same color-coding scheme on a report. It would be way easier to be able to transfer the formatted text from the string indicator. This is particularly annoying, because the information is there, stored in the data structure associated with the string indicator. But how can I put my hands on it? Any ideas?

  • How I can copy text from website or ms word to photoshop with its style?

    How I can paste the multicolor text to photoshop? Let say that half of text is green and other half is blue

    I see no default way to do that.
    A work-around might be creating pdfs and placing those as Smart Objects.

Maybe you are looking for