Why can't I use regular expressions?

I'm trying to use a regular expression but it won't work. :-{  When I try to compile my bling.java file, it doesn't work. It chokes on the following line...
import java.util.regex.*;
The error message I get is...
bling.java:7: cannot resolve symbol
symbol : class regex
location: package util
import java.util.regex;
^
1 error
From my understanding, all I need is a newer version of the SDK.
If I do a "java -version", I get...
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
--------------------------

Here's an update... I change my source code and it still bombs. Take a look. Help is appreciated.
// file : bling.java
import java.util.regex.*;
class bling {
     public static void main(String[] args) {
          System.out.println("Hello!");
bling.java:2: package java.util.regex does not exist
import java.util.regex.*;
^
1 error

Similar Messages

  • Why can't I use Signal Express as a Front End to my LV application?

    Why not make an API for Signal Express so I can use its
    functionality as a front-end to my LV
    applications.
    It is very powerful and user friendly so why have LV developers recreate
    the wheel? Give an interface to access a SE project via LV
    to get data and pass results into LV
    so we can then use its power to make quicker more user friendly applications.
    SE could run in the background as the analyzer and the LV application call SE to get the portions of
    the data it needs.
    Even an automatic VI compiler on SAVE would be a start so a user
    could edit a project in SE close it and it would compile the VI which the LV program calls.
    LabVIEW developers typically do not have 6-18months to
    design and perfect a powerful user friendly interface and are stuck using MAX
    and its inadequacies which is much less impressive.

    Arron,
    I agree that it would be a good idea to include this functionality and have filed a product suggestion.  To file a suggestion, you can go to www.ni.com/contact and click on the link in the lower left hand corner for product feedback.  Thanks for letting us know!
    Regards,
    Craig D
    Applications Engineer
    National Instruments

  • Trying to use regular expressions to convert names to Title Case

    I'm trying to change names to their proper case for most common names in North America (esp. the U.S.).
    Some examples are in the comments of the included code below.
    My problem is that *retName = retName.replaceAll("( [^ ])([^ ]+)", "$1".toUpperCase() + "$2");* does not work as I expect. It seems that the toUpperCase method call does not actually do anything to the identified group.
    Everything else works as I expect.
    I'm hoping that I do not have to iterate through each character of the string, upshifting the characters that follow spaces.
    Any help from you RegEx experts will be appreciated.
    {code}
    * Converts names in some random case into proper Name Case. This method does not have the
    * extra processing that would be necessary to convert street addresses.
    * This method does not add or remove punctuation.
    * Examples:
    * DAN MARINO --> Dan Marino
    * old macdonald --> Old Macdonald <-- Can't capitalize the 'D" because of Ernst Mach
    * ROY BLOUNT, JR. --> Roy Blount, Jr.
    * CAROL mosely-BrAuN --> Carol Mosely-Braun
    * Tom Jones --> Tom Jones
    * ST.LOUIS --> St. Louis
    * ST.LOUIS, MO --> St. Louis, Mo <-- Avoid City Names plus State Codes
    * This is a work in progress that will need to be updated as new exceptions are found.
    public static String toNameCase(String name) {
    * Basic plan:
    * 1. Strategically create double spaces in front of characters to be capitalized
    * 2. Capitalize characters with preceding spaces
    * 3. Remove double spaces.
    // Make the string all lower case
    String retName = name.trim().toLowerCase();
    // Collapse strings of spaces to single spaces
    retName = retName.replaceAll("[ ]+", " ");
    // "mc" names
    retName = retName.replaceAll("( mc)", " $1");
    // Ensure there is one space after periods and commas
    retName = retName.replaceAll("(\\.|,)([^ ])", "$1 $2");
    // Add 2 spaces after periods, commas, hyphens and apostrophes
    retName = retName.replaceAll("(\\.|,|-|')", "$1 ");
    // Add a double space to the front of the string
    retName = " " + retName;
    // Upshift each character that is preceded by a space
    // For some reason this doesn't work
    retName = retName.replaceAll("( [^ ])([^ ]+)", "$1".toUpperCase() + "$2");
    // Remove double spaces
    retName = retName.replaceAll(" ", "");
    return retName;
    Edited by: FuzzyBunnyFeet on Jan 17, 2011 10:56 AM
    Edited by: FuzzyBunnyFeet on Jan 17, 2011 10:57 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hopefully someone will still be able to provide a RegEx solution, but until that time here is a working method.
    Also, if people have suggestions of other rules for letter capitalization in names, I am interested in those too.
    * Converts names in some random case into proper Name Case.  This method does not have the
    * extra processing that would be necessary to convert street addresses.
    * This method does not add or remove punctuation.
    * Examples:
    * CAROL mosely-BrAuN --> Carol Mosely-Braun
    * carol o'connor --> Carol O'Connor
    * DAN MARINO --> Dan Marino
    * eD mCmAHON --> Ed McMahon
    * joe amcode --> Joe Amcode         <-- Embedded "mc"
    * mr.t --> Mr. T                    <-- Inserted space
    * OLD MACDONALD --> Old Macdonald   <-- Can't capitalize the 'D" because of Ernst Mach
    * old mac donald --> Old Mac Donald
    * ROY BLOUNT,JR. --> Roy Blount, Jr.
    * ST.LOUIS --> St. Louis
    * ST.LOUIS,MO --> St. Louis, Mo     <-- Avoid City Names plus State Codes
    * Tom Jones --> Tom Jones
    * This is a work in progress that will need to be updated as new exceptions are found.
    public static String toNameCase(String name) {
         * Basic plan:
         * 1.  Strategically create double spaces in front of characters to be capitalized
         * 2.  Capitalize characters with preceding spaces
         * 3.  Remove double spaces.
        // Make the string all lower case
        String workStr = name.trim().toLowerCase();
        // Collapse strings of spaces to single spaces
        workStr = workStr.replaceAll("[ ]+", " ");
        // "mc" names
        workStr = workStr.replaceAll("( mc)", "  $1  ");
        // Ensure there is one space after periods and commas
        workStr = workStr.replaceAll("(\\.|,)([^ ])", "$1 $2");
        // Add 2 spaces after periods, commas, hyphens and apostrophes
        workStr = workStr.replaceAll("(\\.|,|-|')", "$1  ");
        // Add a double space to the front of the string
        workStr = "  " + workStr;
        // Upshift each character that is preceded by a space and remove double spaces
        // Can't upshift using regular expressions and String methods
        // workStr = workStr.replaceAll("( [^ ])([^ ]+)", "$1"toUpperCase() + "$2");
        StringBuilder titleCase = new StringBuilder();
        for (int i = 0; i < workStr.length(); i++) {
            if (workStr.charAt(i) == ' ') {
                if (workStr.charAt(i+1) == ' ') {
                    i += 2;
                while (i < workStr.length() && workStr.charAt(i) == ' ') {
                    titleCase.append(workStr.charAt(i++));
                if (i < workStr.length()) {
                    titleCase.append(workStr.substring(i, i+1).toUpperCase());
            } else {
                titleCase.append(workStr.charAt(i));
        return titleCase.toString();
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Searching for a substring using Regular Expression

    I have a lengthy String similar to repetetion of the one below
    String str="<option value='116813070'>Something1</option><option value='ABCDEF' selected>Something 2</option>"I need to search for the Sub string "<option value='ABCDEF' selected>" (need to get the starting index of sub string) and but the value ABCDEF can be anything numberic with varying length.
    Is there any way i can do it using regular expressions(I have no other options than regular expression)?
    thanks in advance.

    If you go through the tutorial then you will find this on the second page:
    import java.io.Console;
    import java.util.regex.Pattern;
    import java.util.regex.Matcher;
    public class RegexTestHarness {
        public static void main(String[] args){
            Console console = System.console();
            if (console == null) {
                System.err.println("No console.");
                System.exit(1);
            while (true) {
                Pattern pattern =
                Pattern.compile(console.readLine("%nEnter your regex: "));
                Matcher matcher =
                pattern.matcher(console.readLine("Enter input string to search: "));
                boolean found = false;
                while (matcher.find()) {
                    console.format("I found the text \"%s\" starting at " +
                       "index %d and ending at index %d.%n",
                        matcher.group(), matcher.start(), matcher.end());
                    found = true;
                if(!found){
                    console.format("No match found.%n");
    }It's does everything you need and a bit more. Adapt it to your needs then write a regular expression. Then if you have problems by all means come back and post them up here, but first at least attempt to solve it yourself.

  • I used an American Express card to purchase my Ipad from Apple online. I have an Apple ID. why can't I use Amex as my payment method when signing in to Itunes?

    I have an Apple ID, created when I recently purchased an ipad from Apple online. I used my Amex as payment method. Why can I not use my Amex as payment method when signing in to iTunes for the first time?

    Yup, I'm a Kiwi, living in sunny Blenheim. Just seems odd that I can use Amex for purchasing in the Apple store but not in the iTunes store. Perhaps the higher charge set by Amex is not  economic for small purchases? Anyway,
    I know now what to do now - buy an iTunes gift card and enter the activation code to redeem and sign up. Sorted! Thanks Kappy for taking an interest in my query.

  • Using Regular Expressions for Completion

    I'm trying to build a text completer for a simple little editor. The general idea is that I have a regular expression which describes the syntax of an expression and a set of strings which are all semantically valid cases of the expression (the latter of which is not particularly important to my problem). I would like to be able to determine, using the expression described, whether or not a section of text is capable of beginning a syntactically valid expression, not matching it.
    For example, given the expression
    "#[A-Za-z0-9]#" the string "#name#" is syntactically valid, whereas the string "#_blarg" is not. What I would like to do is be able to determine that "#partial" has the potential to match the pattern with more input, even if it doesn't yet. Specifically, the eventual use will be in such a case as the string X=#partial+3. If the cursor is positioned before the "+" and my user presses the completion keystroke, I want to recognize that "#partial" is what I need to recognize. Also, positioning the cursor immediately after the "=" and pressing the keystroke will do nothing, since nothing before the "=" is capable of matching the pattern properly.
    Is this possible? I don't have to use this exact approach, but it is important that I be able to use the regular expression in detecting a partially completed expression. If I can, the set of regular expressions which already exist in the code can be used to drive the auto completer. Otherwise, I'll have to write a special recognition module for each case; that wouldn't be pretty.
    Thanks for your time! I'll provide other information upon request, if it'd help. :)

    Thank you both for discussing this; it has definitely helped me in reaching a better understanding of uncle_alice's answer to my problem. I've adjusted my code to use this approach and, for the most part, it seems to work.
    I say "for the most part" because I am compiling Patterns with the case insensitivity flag. This appears to do horrible, horrible things. Take a look at the following code, modified from uncle_alice's example:
    String[] str = {"#test#hello", "#tes", "blargblarg", "", "#test#", "S"};
    String rgx = "#[A-Za-z0-9]+#";
    Pattern pc = Pattern.compile(rgx);
    Pattern pi = Pattern.compile(rgx, Pattern.CASE_INSENSITIVE);
    for (String s : str)
        System.out.println("    For string: "+s);
        for (Pattern p : new Pattern[]{pc, pi}) // once for each pattern
            Matcher m = p.matcher(s);
            if (m.matches())
                System.out.printf("Matched '%s'", m.group());
            } else
                System.out.print("No match");
            System.out.println("; hitEnd = " + m.hitEnd());
    }That produces the following output:
        For string: #test#hello
    No match; hitEnd = false
    No match; hitEnd = true
        For string: #tes
    No match; hitEnd = true
    No match; hitEnd = true
        For string: blargblarg
    No match; hitEnd = false
    No match; hitEnd = true
        For string:
    No match; hitEnd = true
    No match; hitEnd = true
        For string: #test#
    Matched '#test#'; hitEnd = false
    Matched '#test#'; hitEnd = false
        For string: S
    No match; hitEnd = false
    No match; hitEnd = trueIt would seem that, with the case-insensitive flag set, hitEnd always returns true unless a match is found. Why is this? I find it quite confusing.
    I can adjust my design to accomodate if this problem cannot be circumvented; however, I'd like to understand what has going wrong here. :)
    Cheers! Thanks so much for all your help!

  • Why can't I use my normal mail account for synching notes

    Hi there,
    I maintain my father's iDevices/computers as he has Parkinsons and does not understand the technology behind how these services work. I need to maintain as simple a configuration as possible. As an example calendaring is difficult as new entries are not necessarily put in the calendar he uses and I have to talk him through how to show all calendars on a regular basis. I can't have his mail on IMAP as he cannot manage his mail and his mailbox fills up. I can't simply pay for storage ad infinitum - my local copy of his mail is about 6 GB and growing.
    I have seen several discussions where it is clear that we *must* use an icloud.com e-mail account for synching notes via IMAP, but none of them have explained WHY I MUST USE @icloud.com e-mail. If this is an IMAP based service why can't I use any other IMAP server
    I see that it is referred to as an "icloud account" but if I have to enable mail, it becomes an e-mail account, which I do not want as it will be confusing if there is an issue with the main mail server (which I maintain) it will present an option to use the icloud.com e-mail as a valid option to send the mail.
    I do not turn on the mail option in icloud.. (only calendar, contacts, reminders and find my iphone). I find it dissapointing that this is now what seems to be a "requirement".

    thecpat wrote:
    WHY I MUST USE @icloud.com e-mail. If this is an IMAP based service why can't I use any other IMAP server
    That is absolutely unnecessary, but more convenient to have icloud to sync your notes. I use other IMAPs as well and can sync my notes with google and yahoo and icloud(corresponding email is required in all cases). It is your choice and you can pick your poison, but you will find out that icloud is more convenient after you or him will lose his info few times. There is no requirement, you can even use the group that will not sync with anything "on my device" if you disable all of IMAPS. Icloud is just the one that you can call Apple and normally people prefer to work with Apple support way more then with google's or yahoo's, but that is again up to your preference.

  • Using regular expressions in java

    Does anyone of you know a good source or a tutorial for using regular expressions in java.
    I just want to look at some examples....
    Thanks

    thanks a lot... i have one more query
    Boundary matchers
    ^      The beginning of a line
    $      The end of a line
    \b      A word boundary
    \B      A non-word boundary
    \A      The beginning of the input
    \G      The end of the previous match
    \Z      The end of the input but for the final terminator, if any
    \z      The end of the input
    if i want to use the $ for comparing with string(text) then how can i use it.
    Eg if it is $120 i got a hit
    but if its other than that if should not hit.

  • Changeparticular characters in a string by using regular expressions ...

    Hello Everyone,
    I am trying to write a function by using oracles regular expression function REGEXP_REPLACE but I could not succed till now.
    My problem as follows, I have a text in a column for example let say 'sdfsdf Sdfdfs Sdfd' I want replace all s and S characters with X and make the text look like 'XdfXdf XdfdfX Xdfd'.
    Is it possible by using regular expressions in oracle ?
    Can you give me some clues ?
    Thank you

    SSU wrote:
    Hello Everyone,
    I am trying to write a function by using oracles regular expression function REGEXP_REPLACE but I could not succed till now.
    My problem as follows, I have a text in a column for example let say 'sdfsdf Sdfdfs Sdfd' I want replace all s and S characters with X and make the text look like 'XdfXdf XdfdfX Xdfd'.
    Is it possible by using regular expressions in oracle ?
    Can you give me some clues ?
    Thank you
    SQL> SELECT
      2  regexp_replace('sdfsdf Sdfdfs Sdfd','s|S','X') from dual;
    REGEXP_REPLACE('SD
    XdfXdf XdfdfX XdfdRegards,
    Achyut

  • Using regular expressions for validating time fields

    Similar to my problem with converting a big chunk of validation into smaller chunks of functions I am trying to use Regular Expressions to handle the validation of many, many time fields in a flexible working time sheet.
    I have a set of FormCalc scripts to calculate the various values for days, hours and the gain/loss of hours over a four week period. For these scripts to work the time format must be in HH:MM.
    Accessibility guidelines nix any use of message box pop ups so I wanted to get around this by having a hidden/visible field with warning text but can't get it to work.
    So far I have:
    var r = new RegExp(); // Create a new Regular Expression Object
    r.compile ("^[00-99]:\\] + [00-59]");
    var result = r.test(this.rawValue);
    if (result == true){
    true;
    form1.flow.page.parent.part2.part2body.errorMessage.presence = "visible";
    else (result == false){
    false;
    form1.flow.page.parent.part2.part2body.errorMessage.presence = "hidden";
    Any help would be appreciated!

    Date and time fields are tricky because you have to consider the formattedValue versus the rawValue. If I am going to use regular expressions to do validation I find it easier to make them text fields and ignore the time patterns (formattedValue). Something like this works (as far as my very brief testing goes) for 24 hour time where time format is HH:MM.
    // form1.page1.subform1.time_::exit - (JavaScript, client)
    var error = false;
    form1.page1.subform1.errorMsg.rawValue = "";
    if (!(this.isNull)) {
      var time_ = this.rawValue;
      if (time_.length != 5) {
        error = true;
      else {
        var regExp = /^([01]?[0-9]|2[0-3]):[0-5][0-9]$/;
        if (!(regExp.test(time_))) {
          error = true;
    if (error == true) {
      form1.page1.subform1.errorMsg.rawValue = "The time must be in the format HH:MM where HH is 00-23 and MM is 00-59.";
      form1.page1.subform1.errorMsg.presence = "visible";
    Steve

  • Using regular expressions for validation in i18n

    Can we use regular expressions for validation of inputs in a java application taking care of i18N aspects too. Zip code for different locales are different. Can we use regular expressions to validate zipcode inputs from different locales

    hi,
    For that shall i have to create individual patterns for matching the inputs from different locales or a single pattern will do in the case of validating phone nos. around the world, zip codes etc. In case different patterns are required, programmer should have a konwledge of difference in patters for different locales.
    regards
    sdas

  • Matching substrings between square brackets using regular expressions

    Hello,
    I am new at Java and have a problem with regular expressions. Let me describe the issue in 3 steps:
    1.- I have an english sentence. Some words of the sentence stand between square brackets, for example "I [eat] and [sleep]"
    2- I would like to match strings that are in square brackets using regular expressions (java.util.regex.*;) and here is the code I have written for the task
    +Pattern findStringinSquareBrackets = Pattern.compile("\\[.*\\]");+
    +     Matcher matcherOfWordInSquareBrackets = findStringinSquareBrackets.matcher("I [eat] and [sleep]");+
    +//Iteration in the string+
    +          while ( matcherOfWordInSquareBrackets.find() )+
    +{+
    +          System.out.println("Patter found! :"+ outputField.getText().substring(matcherOfWordInSquareBrackets.start(), matcherOfWordInSquareBrackets.end())+"");     +
    +          }+
    3- the result I have after running the code described in 2 is the following: *Patter found!: [eat] and [sleep]*
    That is to say that not only words between square brackets are found but also the substring "and". And this is not what I want.
    What I would like to have as a result is:
    *Patter found!: [eat]*
    *Patter found!: [sleep]*
    That is to say I want to match only the words between the square brackets and nothing else.
    Does somebody know how to do this? Any help would be great.
    Best regards,
    Abou

    You can find the words by looping through the sentence and then return the substring within the indexes.
    int start=0;
    int end=0;
    for(int i=0; i<string.length(); i++)
       if(string.substring(i,i+1).equals("[");
      start=i;
    if(start!=0)
    if(string.substring(i,i+1).equlas("]");
    end=i;
    return string.substring(start,end+1);
    }something like that. This code will only find the firt word however. I do not know much about regex so I cannot help anymore.
    Edited by: elasolova on Jun 16, 2009 6:45 AM
    Edited by: elasolova on Jun 16, 2009 6:46 AM

  • HT1541 Why can't I use store credit to gift apps?

    I have money on my Apple ID and want to gift apps.  I don't want to register a credit card.  Why can't I use my store credit to gift?

    I went to the specific trouble of creating a user account here just to express how idiotic that answer is..
    Some people don't have credit cards, that's why we use apple gift cards to up our balance in the first place.
    Lovely how this isn't possible..

  • Checking valid e-mail's using Regular expressions

    Hey buddies ,
    I desperately need some help here. I need to develop a generic method that wiull use regular expressions and patterns to validate an e-mail.
    Does anyonw have any idea on how to do this. And if possible please share some code with me.
    Thanks a lot

    You can do regular expresions in java using java.util.regex.*:
    import java.util.regex.*;
       Pattern p = Pattern.compile("\\S++\\s++");
       Matcher m = p.matcher(sInputLine);
       if(m.find()){
          sUser = m.group().trim();
       }For more info on regular expressions in java, check out the javadocs:
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/Pattern.html

  • Requirement to update a column by using Regular Expression

    Hi All,
        I have a requirement to update a column which is having values like below code.
    based on the conditinos I need to update from ‘E’ to ‘Z’.  Few positions I need to update and remaining positions I need leave as it is.
    How I can achive this requirement by using regular expression regexp_replace.
    Actual value --> 'AEAAAEAA    EE    AA    EE    AA    EE    EEEAA    AA    AA       '
    After update -->  'AZAAAZAA    EE    AA    EE    AA    EE    EEEAA    AA    AA       '

    below is my requirement. I am adding the conditions dynamically as per the conditions. I dont know the position of the E. If 'E' is in any position I need to update with 'Z' if that 'E' satisfy the condition.
    I dont want to update all the E's to Z's.
    I want to update specific E's which satisfy the condition.
        IF l_kwhhilow >= 1 THEN
            l_where := l_where||' SUBSTR(OVERRIDEFIELD,1,1) = ''E'' OR ';
            l_exp := l_exp||'Z';
        ELSE
            l_exp := l_exp||'\1';
        END IF;
        IF l_kwhilow >= 1 THEN
            l_where := l_where||' SUBSTR(OVERRIDEFIELD,2,1) = ''E'' OR ';
             l_exp := l_exp||'Z';
        ELSE
            l_exp := l_exp||'\2';
        END IF;
        IF l_kvahilow >= 1 THEN
            l_where := l_where||' SUBSTR(OVERRIDEFIELD,3,1) = ''E'' OR ';
             l_exp := l_exp||'Z';
        ELSE
            l_exp := l_exp||'\3';
        END IF;
        IF l_kvarhilow >= 1 THEN
            l_where := l_where||' SUBSTR(OVERRIDEFIELD,4,1) = ''E'' OR ';
             l_exp := l_exp||'Z';
        ELSE
            l_exp := l_exp||'\4';
        END IF;
        IF l_todkwh1hilow >= 1 THEN
            l_where := l_where||' SUBSTR(OVERRIDEFIELD,5,1) = ''E'' OR ';
             l_exp := l_exp||'Z';
        ELSE
            l_exp := l_exp||'\5';
        END IF;
        IF l_todkwh2hilow >= 1 THEN
            l_where := l_where||' SUBSTR(OVERRIDEFIELD,6,1) = ''E'' OR ';
             l_exp := l_exp||'Z';
        ELSE
            l_exp := l_exp||'\6';
        END IF;
        l_exp := ''''||l_exp||'''';
        l_exp1 := '\1\2\3\4'||l_exp1;
        IF l_todkw1hilow >= 1 THEN
            l_where := l_where||' SUBSTR(OVERRIDEFIELD,11,1) = ''E'' OR ';
             l_exp1 := l_exp1||'Z';
        ELSE
            l_exp1 := l_exp1||'\5';
        END IF;
        IF l_todkw2hilow = 1 THEN
            l_where := l_where||' SUBSTR(OVERRIDEFIELD,12,1) = ''E'' OR ';
             l_exp1 := l_exp1||'Z';
        ELSE
            l_exp1 := l_exp1||'\6';
        END IF;
        l_exp1 := ''''||l_exp1||'''';
    IF i give 10 in the regexp_replace it is not working.
    SET OVERRIDEFIELD =     REGEXP_REPLACE(SUBSTR(overridefield,1,6), ''(.)(.)(.)(.)(.)(.)'','||l_exp||')'||
                                              ' ||REGEXP_REPLACE(SUBSTR(overridefield,7,6), ''(.)(.)(.)(.)(.)(.)'','||l_exp1||')'||
                                              ' ||SUBSTR(overridefield,13)'||

Maybe you are looking for