JDK 1.6 Supported Regular Expression Optimizations

Hi all,
Thanks in advance for your help.
I'm reading Mastering Regular Expressions my Jeffrey Friedl. In Chapter6, the author discusses many regex engine optimizations that are out there. Is there a complete list of these optimizations that are supported by the latest version of JDK 1.6?
Thanks.

Hi
Check this Note 716604 - Access to Sun J2SE and recommended J2SE options
http://java.sun.com/products/archive/
Regards
Uday

Similar Messages

  • Validate form entries: does java support regular expressions?

    i want to validate form entries, does java support regular express like javascript?

    Just recently in 1.4 regex was finally introduced :)
    Take a look at http://developer.java.sun.com/developer/technicalArticles/releases/1.4regex/

  • Do J2ME support Regular Expressions?

    If yes, how can i do that
    i want to get a html page by the j2me
    and use Regular Expressions to get all link from it (eg. http://yahoo.com/123.php )

    you can write your own code to do it parsing the text using a blank space to separate words, then analize them. I guess sun wont support regular expressions sooner but you can code it if needed.

  • Does Applescript include and support Regular Expressions?

    I'm starting to study regular expressions, and I just discovered AppleScript. So I wondered if AppleScript - or some other Mac utility - offers features that help with regular expressions.
    I'm trying to figure out a variety of search and replace operations. For example, I'd like to copy a table, then replace every row in Table A that includes the word "billion," replacing every row with the word "million" in Table B.
    I just wondered if AppleScript offers any shortcuts for figuring out complex regex operations like this.
    Thanks.

    While AppleScript has the usual kinds of comparisons, I don't know if I would consider them regular expressions. The Terminal gives you access to various utilities that do use regular expressions - see the bash and re_format manual pages.

  • Does as2 support regular expressions?

    I'm coding in AS2 using CS4 if it matters.  Can I use regular expressions in this environment?

    AS2 doesn't come with regular expression class but oters have written them.  I found a good one. http://www.jurjans.lv/flash/RegExp.html

  • Regular Expressions in num-exp

    Hello All,
    I had a problem on my SRST gateway with num-exp insterting a repeating pattern into my 7-digit dialing when in fallback mode.
    For a brief example, the 7digit internal dialing is 21621.. or 21622..
    The num-exp statement of 'num-exp 2... 2162...' was not allowing me to 7-digit dial directly from one IP phone to another while in fallback mode.
    When I dialed 2162154 the 2162 would hit the num-exp and be expended to 2162162.
    I have a work around that uses a voice translation-rule, applied to the call-manager-fallback config that will translate a 7-digit dialed string to the 4 digit dialed string which then hits the 4-digit to 7-digit num-exp and it is working fine.
    However, I was wondering if there is a way to  use regular expressions in num-exp so that perhaps I can skip the intermediate step of using the translation-rule. Based off my existing translation-rules that are working properly, I figured something like this might work for num-exp:
    'num-exp /^2\([12]..$\)/ /2162\1/'
    But when I try to issue a num-exp with a regular expression I get the following message.
    Incorrect format for Number macro pattern
            regular expression must be of the form  ^((\+)?([0-9#*A-F.]|(\\\*))+(\$)?)$
    I have tried a number of different combinations with no success.  I always get the same message.  The regular expression that I tried first was:
    'num-exp ^2... 2162...'
    This is when I first saw the "Incorrect format..." message and figured that is must be possible.  Is this just a generic warning similar to when you try to use complex regular expressions with the 'translation-rule' command vs. the 'voice translation-rule' command and in reality you cannot use regular expressions in the num-exp command?
    Thank you,
    Leo

    Hi Chris,
    Thank you for taking the time to answer my question.  It looks like the answer is no, num-exp does not support regular expressions.
    I don't insist on using num-exp for this I was just hoping to kill two birds with one stone and possibly skip the intermediate step of translating the 7-digits dial to 4-digits using a translation-rule just to expand from 4-digit to 7 again.  This is only an issue while in SRST if a user tries to dial using 7-digits.  We have a 7-digit internal dialing scheme and normally my num-exp is just to expand the 4 digits sent from the telco to our 7-digit internal dialing.  The problem is that both our prefix and part of our DID range start with 21 so while in SRST if a user tried to dial a 7-digit DN, say 2162154, after they dialed the 4th digit (2162) that pattern would hit the num-exp and get expanded to 2162162.  I was hoping to create a num-exp using a regular expression that would only expand a four digit string that begins with a 2 to seven digits and not any string that begins with a 2.  This would 1) expand the four digits sent from the telco and 2) not match a seven digit string that begins with a 2 such as 2162154 which may be dialed by a user.
    Again, this is only an issue while in SRST and I have a pretty good work around so I'm fine with not being able to use a regular expression as part of my num-exp config.  I just thought it would be a cool application of a regular expression if it was possible.
    Thanks again for answering my question.
    Leo

  • Regular Expression and PL/SQL help

    I am using Oracle 9i, does 9i support regular expression? What functions are there?
    My problem is the birth_date column in my database comes from teleform ( a scan program that reads what people wrote on paper), so the format is all jacked up.... 50% of them are 01/01/1981, 10% are 5/14/1995, 10% are 12/5/1993, 10% are 1/1/1983, 10% are 24-JUL-98. I have never really used regular expression and pl/sql, can anybody help me convert all of them to 01/01/1998?
    Does Oralce 9i support regular expression? What can I do if oralce 9i does not support regular expression? Thank you very much in advance.

    9i doesn't support regular expressions (at least not in the 10g regular expressions sense. There is an OWA_PATTERN_MATCH package that has some facilities for regular expressions). But it doesn't look like this is a regular expressions problem.
    Instead, this is probably a case where you need to
    - enumerate the format masks you want to try
    - determine the order you want to try them
    - write a small function that tries each format mask in succession until one matches.
    Of course, there is no guarantee that you'll ever be able to convert the data to the date that the user intended because some values will be ambiguous. For example, 01/02/03 could mean Feb 1, 2003 or Jan 2, 2003 or Feb 3, 2001 depending on the person who entered the data.
    Assuming you can define the order, your function would just try each format mask in turn until one generated a valid date, i.e.
    BEGIN
      BEGIN
        l_date := TO_DATE( p_string_value, format_mask_1 );
        RETURN l_date;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END;
      BEGIN
        l_date := TO_DATE( p_string_value, format_mask_2 );
        RETURN l_date;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END;
      BEGIN
        l_date := TO_DATE( p_string_value, format_mask_3 );
        RETURN l_date;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END;
      BEGIN
        l_date := TO_DATE( p_string_value, format_mask_N );
        RETURN l_date;
      EXCEPTION
        WHEN OTHERS THEN
          NULL;
      END;
      RETURN NULL;
    END;Justin

  • Can I use regular expressions in Java 1.3

    Hi,
    Dose Java 1.3 suport regular expressions?
    How can I use it?
    Thanks.
    bevin ye

    The 1.3 core API doesn't support regular expressions. Hint: There's an item "Since:" in the JavaDoc of most classes that indicates the version it was initially available. If you look it up in the JavaDoc of java.util.regex.Pattern you'll notice that it's value is 1.4.
    But there are several third party libraries that implement regular expressions, 'though I've not used them extensivly, so I can't tell you which one's the most usefull.

  • Regular expressions in JavaScript for CP5?

    I'm having trouble implementing a regular expression from within the JavaScript window. First of all, does CP 5 support regular expressions?

    On slide 1 I have a Text Entry Box, (called TheTeb) with a Submit button. TheTeb has variable associated with it called TypedText.
    In the box, the user may type anything.
    On slide 2 there is a caption.
    The caption must show the text that the user typed  into TheTeb but filtered so that only the letters, numbers, and spaces can be shown.
    For example,
    if the user types:           123 & abc /DEF
    the caption will show: 123 abc DEF
    This requirement is represents the behavior of an application that I am simulating, so I don't want to change the interaction in any way.
    My strategy is to use 2 different variables, one for the text entry box (TypedText), the other for the caption (FilteredText). I can add JavaScript to the On Enter event of slide 2. The script will Get the TypedText, pass the TypedText to FilteredText, and run a regular expression somewhere so the filtered text displays on slide 2.
    Here's the script so far:
    var objCP = document.Captivate;    
    var ScriptTypedText = objCP.cpEIGetValue('TypedText');
    function ReturnValue(){    
      objCP.cpEISetValue('FilteredText', ScriptTypedText);
    ReturnValue();
    The script works as is. The user types text on slide 1 (as TypedText), presses Enter and the text shows up on slide 2 (as $$FilteredText$$). Obviously, the trouble is, I don't know where to add my regular expression into the JavaScript so the text actually gets filtered. Do I make a new function?
    By the way, a sort of pseudocode syntax for the expression would be:
    FilteredText = TypedText.replace(/ /g,"");

  • Regular expressions in Oracle 9i

    Hello,
    Does oracle 9i support regular expressions?
    I need to check if a varchar parameter contains only numbers OR letters, otherwise i should return false.
    Thanks.

    Roger22 wrote:
    Hello,
    Does oracle 9i support regular expressions?
    I need to check if a varchar parameter contains only numbers OR letters, otherwise i should return false.
    Thanks.TRANSLATE is helpful to do such a check.
    example
    WITH testdata AS
       (SELECT 'abcdef' txt FROM DUAL UNION ALL
        SELECT '1234567' txt FROM DUAL union all
        SELECT '0' txt FROM DUAL union all
        SELECT '123a4567x00' txt FROM DUAL union all
        SELECT '123.4567,00' txt FROM DUAL
    select txt,
           translate(txt,'a1234567890','a')  numbers_removed,
           translate(txt,'0abcdefghijklonopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','0')  letters_removed
    from testdata;
    TXT            NUMBERS_REMOVED     LETTERS_REMOVED
    abcdef           abcdef     
    1234567             1234567
    0                        0
    123a4567x00     ax     123456700
    123.4567,00     .,     123.4567,00One idea is to check the result for NULL or to compare the length of similiar expressions.
    Problems are usually special chars and how you want to handle that.
    Edited by: Sven W. on Aug 11, 2010 11:07 AM
    Edited by: Sven W. on Aug 11, 2010 11:07 AM

  • Regular Expressions on an online database

    Hi everyone, I'm kinda new so if what I'm about to ask seems crazy bear with me.
    What kind of issues would be involved with using a regular expression to search an online database?
    The Site says that Java 1.4 now supports a great deal of regex functions but I'm wondering would it be possible to type a regex into some control and for t to evaluate this against what's in the Database?
    Am I making sense?
    Thanks everyone,
    Robin Spiteri.

    Normally you access a database via JDBC & SQL. So the question is whether SQL supports regular expressions; this has nothing to do with java (any version). As far as I know regexps are not part of standard SQL although this might not be true for all SQL databases --> I think you cannot use regexps directly to query a database.
    If the database you're using supports regexps, and you are really sure that this will be "THE" database, and the system won't change, you can of course included regexps in the SQL, but that'll make it difficult to move to another database
    What you definitely can do is loop through the resultset and kick out the records you don't want, e.g.
    while(rs.next()) {
      if(!matchMyRegExp(rs.getString(1))) {
        // loop if reg exp is not matched
        continue;
      // do something
    }This should work on any database, but at the cost of transferring more data than needed from the db to the application.

  • Regular Expression in 8i

    Hi,
    I have trouble in regular expressions.. I am trying to do something like this:
    SELECT PRT_DESC FROM tablename
    WHERE SUBSTR(PRT_DESC,5,5) LIKE '[0-9][0-9][0-9][0-9][0-9]'
    Returns 0 rows which is incorrect..
    Can anyone help me out??
    Thanks

    Oracle didn't support regular expressions until 10g. In prior versions, there is an owa_pattern package that may be useful to you here.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Extracting text from a file name on export / import (Regular Expressions??)

    I’m not even sure if the publishing service, File Naming, in Lightroom supports Regular Expressions or not?? Basically I’m trying to extract the left portion of the file name ie: everything before the underscore “_”. When I import a file I rename the file to reflect the current Image sequence number and then append the date the photo was taken; a typical file is as follows “05625_2008-01-05.dng” on export I would like the new name to be only the sequence number in this case “05625.jpg”. Ideally I would then like to append the folder name that contains the file… “05625 - FolderName.jpg.
    I don’t want to go down the road of figuring out the correct syntax if regular expressions aren’t supported. Thanks in advance - CES

    Is the imported sequence number captured in meta data somewhere or is their somewhere that all of the available fields and there reference names can be found???
    Unfortunately not anywhere available to the user (but it's still stored in at least some filed I know off).
    By the way, why did you choose to put the suffix at the beginning of the name (1234_2010-08-13.jpg)? The common practice is to leave the suffix at the end. That will ensure the filenames will sort in chronological order by filename and you could have easily used the suffix when exporting files. You wouldn't have this problem now.

  • Regular Expression compilation problem

    I am trying to use JDK 1.4's regular expression classes to match text that appears with curly braces (e.g. {field1}) using the following regular expression:
    [{]([0-9A-Za-z]+)[}]
    I use this same pattern with the org.apache.regexp and org.apache.oro packages without any problem, but get the following error when running it using the new java.util.regex package in JDK 1.4:
    Exception in thread "main" java.util.regex.PatternSyntaxException: Unexpected character '?' near index 0
    [{]([0-9A-Za-z]+)[}]
    ^
    at java.util.regex.Pattern.error(Pattern.java:1472)
    at java.util.regex.Pattern.range(Pattern.java:2052)
    at java.util.regex.Pattern.clazz(Pattern.java:1991)
    at java.util.regex.Pattern.sequence(Pattern.java:1529)
    at java.util.regex.Pattern.expr(Pattern.java:1489)
    at java.util.regex.Pattern.compile(Pattern.java:1257)
    at java.util.regex.Pattern.<init>(Pattern.java:1013)
    at java.util.regex.Pattern.compile(Pattern.java:760)
    at Test_jdk14.main(Test_jdk14.java:13)
    What am I doing wrong?
    Thanks, Tony

    Hello,
    Let's look at what you've done.
    [\\{]([0-9A-Za-z]+)[}]Okay, first you escape the opening curly brace, but you did not escape the closing curly brace.
    [\\{]([0-9A-Za-z]+)[\\}]Next, you use the square brackets, but you only have one thing in the brackets, so, they are unnecessary:
    \\{([0-9A-Za-z]+)\\}Next, I am going to contract all that stuff inside your remaining square brackets to \\w, since that covers 0-9A-Za-z_
    \\{(\\w+)\\}Now, are you expecting any sort of spaces within the curly brackets? If so, you didn't specify them. I'll assume you didn't.
    Now you did all this, but it still doesn't match what you thought it would match. Did you use Matcher.matches or Matcher.lookingAt?
    If you look at the API for these methods, you'll see that
    a) Matcher.matches(...) only returns true if the entire input sequence matches the pattern.
    b) Matcher.lookingAt(...) only returns true if the start of the input sequence matches the pattern.
    In either of these cases, if your string didn't start with the opening bracket, then the Pattern (in its current form) won't match. For example:
    "{text1}"                       // matches() == true
                                    // lookingAt() == true
    "{text2} blah blah"             // matches() == false
                                    // lookingAt() == true
    "blah blah {text3}"             // matches() == false
                                    // lookingAt() == false
    "blah blah {text4} blah blah"   // matches() == false
                                    // lookingAt() == false
                                    //You would want to use Matcher.find() if you want to find all of these matches.
    However, there is a way to find those matches using Matcher.matches() and Matcher.lookingAt(). All you have to do is put .* in front and behind the thing you're looking for.
    .*\\{([\\w]+)\\}.*This way, any number of characters can come before or after your pattern, and it will still fit the requirements.
    Here's an example:
    import java.util.*;
    import java.util.regex.*;
    public class RegExample
       public static void main( String [] args )
          Pattern p = Pattern.compile( ".*\\{(\\w+)\\}.*" );
          Matcher m = p.matcher( "blah blah {field1} blah blah" );
          if ( m.lookingAt() )
             System.out.println( "We're looking at it." );
          if ( m.matches() )
             System.out.println( "It matches." );
          m.reset();
          if ( m.find() )
             System.out.println( "we found the first match" );
             System.out.println( "It was: " + m.group(1) );
    }

  • Regular Expression Filter Mapping In Web.xml

    I have a situation where I need to filter URL's that don't have a file extension. There are hundreds of URL's, so i can't specify each one separately.
    From what I understand, you can have a filter mapping in web.xml to map certain file extensions to a filter, such as :
    <filter>
    <filter-name>MyFilter</filter-name>
    <filter-class>com.filters.MyFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>MyFilter</filter-name>
    <url-pattern>*.esi</url-pattern>
    </filter-mapping>
    ...where all files of extension .esi go through the filter. Additionally, I want to map all url's WITHOUT a file extension to pass through this filter. So if I have a request for "http://myserver.com/home" it will pass through the filter.
    Does weblogic support regular expressions for pattern matching in filter-mapping? If so, can you provide examples or links to documentation?
    Thanks,
    Jim

    No, regular expressions are not supported. You can specify the mapping with extensions, or with paths, not at the same time in the same mapping specification. However, you can specify two servlet mappings, one with extension, and one with path.
    The exact wording from the spec (2.4) is as follows:
    In the Web application deployment descriptor, the following syntax is used to define
    mappings:
    • A string beginning with a ‘/’ character and ending with a ‘/*’ suffix is used
    for path mapping.
    • A string beginning with a ‘*.’ prefix is used as an extension mapping.
    • A string containing only the ’/’ character indicates the "default" servlet of
    the application. In this case the servlet path is the request URI minus the context
    path and the path info is null.
    • All other strings are used for exact matches only.

Maybe you are looking for

  • Help ! please. my ipod touch will no longer connect to my wifi! driving me crazy!

    Okay I recently moved and changed internet providers. The first couple days i had no problem connecting my ipod touch to my wifi internet and then all the sudden it just disconnected and wont connect back! it connects to other wifi networks just not

  • HT4898 Re Keychain synch not available in iCloud.  Other Options? Evernote?

    Seems crazy that if you add a website password on your iMac in Keychains it will no longer be synched with Keychain on your MacBook pro. What work arounds are you looking at ?  Evernote?  What Other options are you thinking of to have passwords and s

  • JNDI not able to connect

    Hi, I have an environemtn that repeats the same issue again and again. I have a JNDI name using for the database connection taht has the AQ. Some how my process reads messages from the queue, some times it will not read, reason the JNDI name and is n

  • AP-Specific WLAN-VLAN Mapping audit

    Is there anyway to audit the access points in FC mode to determine the WLAN-VLAN mapping and if it is AP or WLAN specific? or Is there a script that I can run to make the WLAN-VLAN mappings on all FC mode APs AP-Specific?

  • Uploading Account Hierarchy data

    Hi all, Can anyone tell me how to upload Account Hierarchy into BI.I have created a flat file with the Hierarchy structure but unable to upload. The File format is Node ID,Info Object Name,Node Name,Link Name,Top Node,From Ac,To Ac,Language, Short Te