How can I add Regular Expression verify?

I need to write a Regular Expression for date whose format is 'yyyy-mm-dd'('2004-5-3' or '2004-05-03') and a Regular Expression for phone number whoes format is '12345678' or '1234567' or '13809441234'.
Thanks for any help.

The date format is a little tricky as there are many invalid combinations. You'd be better off calling TO_DATE with your user input and format mask. If an error is returned, the date is invalid.
For the phone number assuming a valid phone number could be 7, 8, or 11 digits (it's a little difficult to tell what the format your suggest is) then you could apply something like the following:
^[0-9]{7}([0-9]|[0-9]{4})?$
Regards.

Similar Messages

  • How can I use regular expression to open files of certain types in java?

    Ok this is the problem I am facing:
    I have a command line input of something like "/usr/foo/bar/*.html"
    and there are multiple files in that folder that end with .html.
    How can I use the input to go through/open all the .html files in Java?
    Help would be greatly appreciated thanks!

    Or if you have to do it in java, check out the interfaces java.io.FileFilter and java.io.FileNameFilter
    http://home.tiscali.nl/~bmc88/java/sbook/0128.html
    class HTMLFilter implements FilenameFilter {
        public boolean accept(File dir, String name) {
            return (name.endsWith(".html"));
    }Cheers,
    evnafets

  • How can I use regular expression to match this rule

    I have a String ,value is "<a>1</a><a>2</a><a>3</a>",and want to match other String like "<a>1</a><a>8</a>",if the one of the first string(like "<a>1</a>") will occur in the second string,then will return true.but I don't know how to write the regular expresstion.
    Thx

    Fine fine. :P
    I was a little bored, so here's some code that uses Strings and a StringBuffer (though you could use a String in place of the StringBuffer). Is this perhaps better? :)
              String testMain = "<a>1</a><ab>2</ab><ab>3</ab>";
              String test = "<ab>1</ab><ab>3</ab>";
              String open = "<ab>";
              String close = "</ab>";
              StringBuffer search = new StringBuffer();
              String checkString = null;
              int lastCheck = 0;
              int start = 0;
              int finish = 0;
              boolean done = false;
              while (!done) {
                   start = test.indexOf(open);
                   finish = test.indexOf(close);
                   if ((start == -1) || (finish == -1)) {
                        System.out.println("No more tags to search for.");
                        done = true;
                   else {
                        checkString = test.substring((start + open.length()), finish);
                        search = new StringBuffer();
                        search.append(open);
                        search.append(checkString);
                        search.append(close);
                        if (testMain.indexOf(search.toString()) != -1) {
                             System.out.println("Found value: " + checkString);
                        test = test.substring(finish + close.length());
    Resulting output:
    Found value: 3
    No more tags to search for.
    -G

  • I currently have a D-Link DI-604 broadband router with windows computers.  How can I add wifi to the network for use with ipad?  Can I use AirPort Express?

    I currently have a D-Link DI-604 broadband router with windows computers.  How can I add wifi to the network for use with ipad?  Can I use AirPort Express?

    Yes. You can directly connect an 802.11n AirPort Express Base Station (AXn) using an Ethernet cable. The AXn would then just need to be configured as a bridge to allow the D-Link to continue to provide both NAT & DHCP services for all network clients connected to either router.
    In this configuration, the AXn would broadcast a wireless network for your wireless network clients to connect to.

  • How can I add support for JPEG 2000 to Final Cut Express?

    How can I add support for JPEG 2000 to Final Cut Express 4? I need to export an .mov file in the JPEG2000 format but it is not available as a quicktime export option. Is this something that I can add via a quicktime .component? Would appreciate any insight anyone might have... Thank you.

    I believe you need to purchase the QuickTime Pro key ($29.99 USD).  Once you enter the registration number in System Preferences for QuickTime Player 7, it 'unlocks' several export features, including JPEG2000.
    See:
    http://support.apple.com/kb/SP521
    http://support.apple.com/kb/HT3820
    http://support.apple.com/kb/HT2240
    http://store.apple.com/us/product/D3380Z/A/quicktime-7-pro-for-mac-os-x?fnode=62
    -DH

  • How can I add an email account in apple mac which ends with .consulting

    We changed our email account and the domain name is .consulting. How can I add this account to my Mac mail?

    If you are trying to activate an iPad or iPhone and it is asking for a previous Apple ID and password, you have encountered the Activation Lock. This is a security feature that prevents thieves from setting up and using a stolen or lost iPad or iPhone. You have no alternative. You must use the previous Apple ID and password to unlock the device. If you do not know the password you might be able to recover it at this link:
    https://iforgot.apple.com/password/verify/appleid
    This normally will require that info is sent to the primary email address associated with the Apple ID. If you have an alternate email address assigned to that Apple ID you might get the password via the alternate email address.

  • How can I add a new column in compress partition table.

    I have a compress partition table when I add a new column in that table it give me an error "ORA-22856: CANNOT ADD COLUMNS TO OBJECT TABLES". I had cretaed a table in this clause. How can I add a new column in compress partition table.
    CREATE TABLE Employee
    Empno Number,
    Tr_Date Date
    COMPRESS PARTITION BY RANGE (Tr_Date)
    PARTITION FIRST Values LESS THAN (To_Date('01-JUL-2006','DD-MON-YYYY')),
    PARTITION JUNK Values LESS THAN (MAXVALUE));
    Note :
    When I create table with this clause it will allow me to add a column.
    CREATE TABLE Employee
    Empno Number,
    Tr_Date Date
    PARTITION BY RANGE (Tr_Date)
    PARTITION FIRST Values LESS THAN (To_Date('01-JUL-2006','DD-MON-YYYY')),
    PARTITION JUNK Values LESS THAN (MAXVALUE));
    But for this I have to drop and recreate the table and I dont want this becaue my table is in online state i cannot take a risk. Please give me best solution.

    Hi Fahed,
    I guess, you are using Oracle 9i Database Release 9.2.0.2 and the Table which you need to alter is in OLTP environment where data is usually inserted using regular inserts. As a result, these tables generally do not get much benefit from using table compression. Table compression works best on read-only tables that are loaded once but read many times. Tables used in data warehousing applications, for example, are great candidates for table compression.
    Reference : http://www.oracle.com/technology/oramag/oracle/04-mar/o24tech_data.html
    Topic : When to Use Table Compression
    Bug
    Reference : http://dba.ipbhost.com/lofiversion/index.php/t147.html
    BUG:<2421054>
    Affects: RDBMS (9-A0)
    NB: FIXED
    Abstract: ENH: Allow ALTER TABLE to ADD/DROP columns for tables using COMPRESS feature
    Details:
    This is an enhancement to allow "ALTER TABLE" to ADD/DROP
    columns for tables using the COMPRESS feature.
    In 9i errors are reported for ADD/DROP but the text may
    be misleading:
    eg:
    ADD column fails with "ORA-22856: cannot add columns to object tables"
    DROP column fails with "ORA-12996: cannot drop system-generated virtual column"
    Note that a table which was previously marked as compress which has
    now been altered to NOCOMPRESS also signals such errors as the
    underlying table could still contain COMPRESS format datablocks.
    As of 10i ADD/SET UNUSED is allowed provided the ADD has no default value.
    Best Regards,
    Muhammad Waseem Haroon
    [email protected]

  • How can I add a logo to the bottom right of a video?  I have a jpg logo to use.

    How can I add a logo to bottom right of video, using a jpg?

    Even though David's answer is for Final Cut Express, the same answer should apply for FCP X only you would need to place the "track" ... let's say clip ... above the clip it is to overlay.  Thus it can either be a storyline or a connected clip but it should reside above the primary storyline assumming that is where the video is you want your logo to overlay.  As David points out, the type of graphic file should be one that allows the transparent background feature such as a PNG or PSD, etc.  Of course, if your logo has a solid box background, you may be able to simply scale it down and position it to the right place and overlay it over your other video clip using the method described above.  Hope this helps.
    stephen

  • How can i add the airport expres to my network, how can i add the airport expres to my network, how can i add the airport expres to my network

    how can i add the airport expres to my network, how can i add the airport expres to my network, how can i add the airport expres to my network

    elroiew wrote:
    how can i add the airport expres to my network,
    Best way for the first set up is to connect the Express via LAN cable to a computer.
    Then enter the setup of the express and choose "Join a existing network"
    After the setup is done, remove cable and you will see the Express in the Airport Utility
    Lupunus

  • How can i add my own number in imesseges

    Hi my name is kawaljit kaur.suddenly my phm's imesseges stop working...its just using my apple id which i dnt want...plz tell me how can i add my own cell number in imesseges.thnx

    Hi, Kawaljit kaur.
    Thank you for visiting Apple Support Communities. 
    Here are a couple troubleshooting resources I would recommend when experiencing this issue. 
    Phone number missing on iPad or iPod touch
    If your phone number is not listed on an iPod touch or iPad, follow these steps:
    Update to the latest version of iOS.
    Verify that you're using the same Apple ID that you are using on your iPhone.
    On your iPad or iPod touch, sign out of your Apple ID in the following locations:
    Settings > Messages > Send & Receive. Tap your Apple ID, then tap Sign Out.
    Settings > FaceTime. Tap your Apple ID, then tap Sign Out.
    Sign in to your Apple ID with FaceTime and iMessage.
    If your phone number is still not listed, follow these steps:
    Sign out of your Apple ID on all iOS devices, including your iPhone, in the following locations:
    Settings > Messages > Send & Receive. Tap your Apple ID, then tap Sign Out.
    Settings > FaceTime. Tap your Apple ID, then tap Sign Out.
    Sign in to your Apple ID on your iPhone.
    When activation is complete, your Apple ID and all verified email addresses should be visible in Settings > Messages > Receive At and also in Settings > FaceTime.
    Now sign in to your Apple ID on your other iOS devices.
    iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    If you experience any issues with activation, see the article below. 
    iOS: Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/ts4268
    Cheers,
    Jason H. 

  • Deleted the recently added section from the source area how can i add back

    how can i add back the recently added section from the source without reinstalling itunes thanks in advance....
    insp 8100   Windows XP  

    Ok that is easy.
    1) File > New Smart Playlist.
    2) Make sure match the following rule is checked
    3)The first drop down change to date added.
    4)Set the second drop down setting
    5) Enter the number you want based on step 4
    The rest of the check marks are up to you but make sure "Live Updating" is checked.
    Take some time playing around with the smartlists. I love them!! I have a 2 level smartlist at work, I hardly use the regular playlists.

  • HT5312 I've forgot security question and answer, how can I add rescue mail address and how can I reset my security question and answer?

    I've forgot security question and answer, how can I add rescue mail address and how can I reset my security question and answer?

    You need to ask Apple to reset your security questions; ways of contacting them include phoning AppleCare and asking for the Account Security team, clicking here and picking a method for your country, and filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (105466)

  • Add regular expression to spotlite!

    hello!
    i don't really know where to put this request, so i just do it here:
    please add regular expression search to spotlite!
    would be really great and i think not that much of a work..

    And even more effective would be to do a bit of digging before making suggestions to Apple.
    For instance, a simple googling of "spotlight regex" immediately provides a suggestion or two. Checking Spotlight's query syntax might also lead in interesting directions. And, of course, Spotlight (which is a mighty <censored> excuse for a search engine anyway) is really mdfind, and we all know we can pipe mdfind results to grep, don't we?

  • How can I add more than one same spry menu (eg. collapsible menu)  with in different styles (font size, color, background, etc) on current page?

    How can I add more than one same spry menu (eg. collapsible menu)  with in different styles (font size, color, background, etc) on current page?

    Hi Nancy,
    This screenshot was only for imagination. A part of the code (not all) is below.  In the code there are some background images but they are not seem in live mode.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="css/my_site.css" rel="stylesheet" type="text/css" />
    <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css"/>
    <link href="SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
    <style>
    #CollapsiblePanel1 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-color: #003366;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel1 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        line-height: 52px;
    #CollapsiblePanel1 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        line-height: 52px;
    #CollapsiblePanel2 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/international.jpg);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel2 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel2 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel2 .CollapsiblePanelContent {
        background-color: blue;
    #CollapsiblePanel3 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel3 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel3 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel4 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel4 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel4 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel5 .CollapsiblePanelOpen .CollapsiblePanelTab {
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        font-size: 18px;
        line-height: 52px;
        color: #FFF;
    #CollapsiblePanel5 .CollapsiblePanelTabHover .CollapsiblePanelTab {
        background-color: #003366;
        color: #FFF;
        text-shadow: 1px 1px #000;
        font-weight: bold;
        background-image: url(images/TR_Col-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    #CollapsiblePanel5 .CollapsiblePanelClosed .CollapsiblePanelTab  {
        background-color: #C3CFDF;
        border-radius: 5px 5px 0px 0px;
        color: #999
        text-shadow: 1px 1px #000;
        font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
        font-size: 18px;
        font-weight: bold;
        background-image: url(images/TR_Gray2-WEB.png);
        background-repeat: no-repeat;
        line-height: 52px;
    </style>

  • HT201342 How can I add an e-mail address to my existing icloud addresses?  I currently only use one and I would like to ad two more?

    How can I add an e-mail address to my existing icloud account?  I curently only use one of the three.

    Each iCloud account only has a single iCloud account.  If you want, you can add up to 3 alias addresses that will receive email in the same iCloud inbox, as explained here: http://support.apple.com/kb/PH2622.

Maybe you are looking for

  • Problems Please help...zen vision

    I have an Creative Zen vision and installed it and the computer detect it but I cant install it because the computer cant find the drivers? and I have sp2 and windows media player 0... HELP!!

  • Mac Mini Fusion Drive or self built SSD / Fusion drive

    Hi, I am contemplating to buy a Mac Mini i7 2.6GHz but don't really know what I want to do with the Harddrive. One option would of course be to add a Fusion Drive for 200 bucks. However, apple doesn't say anything about the brand or model that they u

  • Can I move 2TB internal HD from old mac to new mac and still access files

    I just upgraded to a new Mac Pro, we have an old G5 Ma Pro thats getting retired. In the old G5 we have an internal 2TB WD drive with all of our customer art files. Can I simply pull the HD from the G5 and stick it in the new Intel machine and have a

  • Sent messages not saving on Exchange server

    Does anyone know how to get emails sent from an MS Exchange account in Mail 8.2 to save (either in Sent folder on local machine or preferably on the Exchange server)? "Store sent messages on the server" is selected, but this doesn't work on any of my

  • Can't login to wiki

    Hello everyone, I can't login to my local Mac OS Server Wiki and also I can't find Directory.app that seems to be needed to add a wiki user. Can anyone point me in the right direction?