Identifying repeating characters in an expression

I'm using 10g and am trying to come up with a regular expression that will allow me to identify strings that have repeating characters... e.g. in the Name field, I want to identify all rows where the value is "AAAAAA", "BBBB" - basically, just a set of repeating values. Similarly, for birthdate, I want to identify dates that might look like '99/99/9999' or '88/88/8888'... is there a regular expression I can build for this?
Help is greatly appreciated.

I don't have 10g to hand, but you can do this without regular expressions.
For name_column it would be
select name_column from my_table
where replace(name_column,substr(name_column,1,1)) is null;Of course you wouldn't even need the second part if you weren't working with a incorrectly designed database - dates should always be stored as dates and then 99/99/9999 couldn't even get into the database, but for some reason people keep doing this to themselves.
select fake_date from my_table
where replace(fake_date,substr(fake_date,1,1).'*') = '**/**/****';

Similar Messages

  • Identifying Czech characters in an instance

    We are trying to identify czech characters in a database instance, to move them into another instance. Kindly let us know how can we do it?
    We are trying to do using ascii values... please share your ideas if any.

    I don't have 10g to hand, but you can do this without regular expressions.
    For name_column it would be
    select name_column from my_table
    where replace(name_column,substr(name_column,1,1)) is null;Of course you wouldn't even need the second part if you weren't working with a incorrectly designed database - dates should always be stored as dates and then 99/99/9999 couldn't even get into the database, but for some reason people keep doing this to themselves.
    select fake_date from my_table
    where replace(fake_date,substr(fake_date,1,1).'*') = '**/**/****';

  • How to find out if there are repeated characters in a string

    hey guys
    well i kinda have a little problem figuring out how to find out
    if there are repeated characters in a string.
    if anyone can help, would appreciate it.
    thanks
    milos

    Try using the StringTokenizer class. if u already know which character to trace. this could do the job.
    eg. String str = "here and there its everywhere";
    StringTokenizer st = new StringTokenizer(str, "e");
    int rep = st.countTokens();

  • Sample code to identify special characters in a string

    Hi,
    I need to identify special characters in a string.... could anybody send me some code please.......
    Thanks,
    Best regards,
    Karen

    data: str(100) type c.
    data: str_n type string.
    data: str_c type string.
    data: len type i.
    data: ofst type i.
    str = '#ABCD%'.
    len = strlen( str ).
    do.
      if ofst = len.
        exit.
      endif.
      if str+ofst(1) co sy-abcde.
        concatenate str_c str+ofst(1) into str_c.
      else.
        concatenate str_n str+ofst(1) into str_n.
      endif.
      ofst = ofst + 1.
    enddo.
    write:/ str.
    write:/ str_c.
    write:/ 'spacial chracter',20 str_n.
    Function module  <b>SF_SPECIALCHAR_DELETE</b> <b>DX_SEARCH_STRING</b>
    l_address1 = i_adrc-street.
    CHECK NOT L_ADDRESS1 IS INITIAL.
    len = STRLEN( l_address1 ).
    do len times.
    if not l_address1+l(1) ca
    'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 '.
    if i_adrc-street+l(1) CO sy-abcde.
    elseif i_adrc-street+l(1) CO L_NUMCHAR.
    exit.
    endif.
    l = l + 1.
    enddo.
    data : spchar(40) type c value '~!@#$$%^&()?...'etc.
    data :gv_char .
    data:inp(20) type c.
    take the string length .
    len = strlen (i/p).
    do len times
    MOVE FNAME+T(1) TO GV_CHAR.
    IF gv_char CA spchar.
    MOVE fnameT(1) TO inp2T(1).
    ENDIF.
    T = T + 1.
    enddo.
    REPORT ZEX4 .
    PARAMETERS: fname LIKE rlgrap-filename .
    DATA: len TYPE i,
    T TYPE I VALUE 0,
    inp(20) TYPE C,
    inp1(20) type c,
    inp2(20) type c,
    inp3(20) type c.
    DATA :gv_char.
    data : spchar(20) type c value '#$%^&*()_+`~'.
    START-OF-SELECTION.
    CONDENSE fname.
    len = strlen( fname ).
    WRITE:/ len.
    DO len TIMES.
    MOVE FNAME+T(1) TO GV_CHAR.
    IF gv_char ca spchar.
    MOVE fnameT(1) TO inpT(1).
    ENDIF.
    T = T + 1.
    ENDDO.
    CONDENSE INP.
    write:/ 'Special Characters :', inp.
    Rewards if useful..........
    Minal

  • Repeated characters in a string????

    hey guys
    well i kinda have a little problem figuring out how to find out
    if there are repeated characters in a string.
    if anyone can help, would appreciate it.
    thanks
    milos

    And now a working version:
        public boolean hasRepeatedChars (String word) {
            boolean found = false;
            int i = 0;
            char lastChar = '\0';
            while ((i != word.length ()) && ! found) {
                char c = word.charAt (i);
                found = ((i != 0) && (c == lastChar));
                lastChar = c;
                i ++;
            return found;
        }

  • Number of repeated characters in string array

    Hi,
    I m trying to get number of repeated characters in string array. I couldnt figure out where am i doing mistake.
    thank you,
    For example: count({"alpha, beta,"}, 'a')
    a is repeated 3
    l is repeated 1 etc.
    public class Test
    public static int count(String[] stringArray, char c)
    public String [] str = new String [2];
    int count = 0;
    str[0]
    str[1]
    for(int i = 0; i<str.length(); i++)
    if (str.charAt(i)
    count++;
    return count;

    There is a difference between a String and a String [].
    A String [] is an array of String class objects:/*  Traverse_Array_Of_Strings_1.java */
    public class Traverse_Array_Of_Strings_1
      public static void main(String [] argv)
        /* here is an array of Strings */
        String [] s = { "hello", "how", "are", "you" };
        int i, j;
        System.out.println("s.length = "+ s.length );
        for (i= 0; i < s.length; i++)
          System.out.println("s= <"+ s[i] +">");
          for (j= 0; j < s.length(); j++)
    System.out.print(s[i].charAt(j) +", ");
    System.out.println("\n-----");
    }output:java> javac Traverse_Array_Of_Strings_1.java
    java> java Traverse_Array_Of_Strings_1
    s.length = 4
    s= <hello>
    h, e, l, l, o,
    s= <how>
    h, o, w,
    s= <are>
    a, r, e,
    s= <you>
    y, o, u,
    Edited by: vim_no1 on Jul 15, 2010 7:43 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Converting String Characters into Regular Expression Automatically?

    Hi guys.... is there any program or sample coding which is available to convert string characters into regular expression automatically when the program is run?
    Example:
    String Character Input: fnffffffffffnnnnnnnnnffffffnnfnnnnnnnnnfnnfnfnfffnfnfnfnfnfnnnnd
    When the program runs, it automatically convert into this :
    Regular Expression Output: f*d

    hey guys.... i am sorry for not providing all the information that you guys need as i was rushing off to urgent meeting... for my string characters i only have a to n.. all these characters are collected from sensors and stored inside database... from many demos i have done... i found out that every demo has different strings of characters collected and these string of characters will not match with the regular expressions that i had created due to several unwanted inputs and stuff... i have a lot of different types of plan activities and therefore a lot of regular expressions.... if i put [a-z|0-9]*... it will capture all characters but in the same time it will be showing 1 plan only.... therefore, i am finding ways to get the strings i collected and let it form into regular expression by themselves in the program so that it will appear as different plans as output with comparing with the regular expression that i had created.... is there any way to do so?
    please post again if there is any questions u are still not familiar with... thank you...

  • Hi, im getting an error message, "expected identifier"  and another one, "expected expression" when i try a c   program in xcode

    hi, im getting an error message, "expected identifier"  and another one, "expected expression" when i try a c   program in xcode

    You have errors in your C code. If you want anyone to be able to help you, you need to post the code. You also should tell us the version of Xcode you're using and the type of Xcode project you created for the C program.

  • Wireless keyboard to iPad repeating characters

    My wireless keyboard periodically repeats characters making typing on the iPad 2 difficult. Got fix?

    Go to Settings app
    Select General
    Make sure Bluetooth is turned on
    Make sure your keyboard is in discovery mode (press the silver button on the right side of the keyboard - the green light will start flashing)
    In the Bluetooth section on the iPad, you should see the wireless keyboard
    Select the found keyboard to pair it with the iPad
    You'll be asked to type a pairing code on the keyboard - if it's entered successfully, your keyboard will be paired with the iPad (or any iOS device with Bluetooth)
    Note that when you are using the Bluetooth keyboard, the normal iPad keyboard does not appear - turn off Bluetooth or the external keyboard (press and hold the button on the right side of the Apple Wireless Keyboard), or travel outside the 10-15m range of Bluetooth to go back to using the regular iPad keyboard

  • Remove repeated characters

    Is there a method in standard Java API that removes the repeated charcter from a string;
    Eg.
    If,
    String str = "baba";
    then the method should return "ba".

    The java.util.regex package contains Java's regular expression library. In particular, you could use the Pattern class to try and find repeating sequences. The Pattern class is described here:
    http://java.sun.com/javase/6/docs/api/index.html?java/util/regex/Pattern.html
    Given a string like "abab", the code below will produce "ab", but given a string like "ababc" it will still produce "ab" (which might be a problem, depending on what you are trying to do):
    String str = ...;
    for(int i = 2; i < str.length() / 2; ++i) {
       Pattern p = Pattern.compile( str.substring(0, i) );
       Matcher m = p.matcher(str);
       int matchCount = 0;
       while(m.find()) {
          ++matchCount;
       if( matchCount > 1 ) {
          m.reset();
          m.find();
          str = m.group();
          break;
    }If you know that the repetition is at most going to occur twice, you can simply split the string in the middle and compare the first and second halves. If they are equal you can just use the first one, and, if they are not equal, you can use the original String. For example:
    //string must have even number of characters
    //or there cannot be a symmetric repetition
    if( str.length() % 2 == 0 )
       String firstHalf = str.substring(0, str.length() / 2);
       String secondHalf = str.substring( string.length() / 2, str.length() );
       //must use equals() method;
       //the == operator only compares if the references point to the same location
       if( firstHalf.equals(secondHalf) ) {
          //there is a repeated sequence; modify str
          str = firstHalf;
       else {
          //do nothing; there is no repeated sequence
    }Edit:
    Sorry, I made a mistake about what groupCount() does. I thought it returned the total number of matches, but it actually returns the number of capturing groups used in the pattern. Both of the algorithms above should work now.

  • Repeated lost of AirPort Express signal on home network w/ Mac and Dell PC

    After a year of steady, reliable home wireless network access with an AirPort Extreme base station and an Express relay in the upstairs, I am suddenly, repeatedly losing signal strength from the Express relay. The Express goes into a flashing amber status when the problem occurs. To solve the issue, I have successfully been able to restart the Express, which works for 12 to 36 hours before the situation happens again. What could have happened to cause this sudden recurring problem and what can be done to resolve it longer term?

    Hello kkinva. Welcome to the Apple Discussions!
    It is very possible that you may have some form of Wi-Fi interference that has been introduced recently in the immediate area that is preventing you from getting a good clean signal between the base stations.
    I suggest you perform a simple site survey, using utilities like MacStumbler or iStumbler to determine potential areas of interference, and then, try to either eliminate or significantly reduce them where possible.

  • How to use special characters in regular expression

    HI all, I am new to regular expression.
    Can any one please tell me the regular expression for characters which are used in regular expression like " [({. tetc.Is there any particular expression to prefix before using these characters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Expression:
    < td .*? bgcolor = \" ( [^ \" ] +) \" \\s* .*? > ( .+? ) </td>
    It will search for expression starting with <td ,
    .*? means any characters zero or more than one,
    then it will find bgcolor = , then literal \"... \(any char) is that specific char
    [ ^ \" ] any character but not literal \",this means there has to be something between ".... " if empty then wont match ,+ is 1 or more times
    Then again literal \ " , after that \\s* means zero or more num of spaces,
    then again , .*? means any characters zero or more than one,
    it will search for literal > , again any chars . * ?
    Finally </td> will be searched.....!!
    So all expressions having this particular structure will be
    matched.
    Output :
    <td align="left" valign="top" bgcolor="ffffff" width="177">bla bla bla</td>

  • Identify special characters that are not supported by an embeded font

    Hi!
    I'm useing embeded fonts as CFF in my flex 4.5.1 application and I have problems with the special charcters  like Ă, Â, Î, Ș, Ț or arabic text, that are not included in my embeded font. This are displayed in my RichEditableTect component useing the default font (Arial).
    Is there any way to block the user when he tries to add such characters? 
    Or can  I identify them before saveing , in order to format the text like <Text Font="ExoticFont"...>Hello<Text font-family="Arial">ë</Text></Text> ?

    I think you want to use Font.hasGlyphs.  If you are using the @font-face directive it is hard to get to the Font class so you may wish to switch to using the directive.

  • Universal Repeater Mode with Airport Express

    Hi all folks,
    is something like the universal repeater mode with the new Airport Express 802.11n (2nd) available.
    Today I use a Airport Express in the Client Mode to connect to a WLAN and I connect my Mac to the Ethernet Port and the Airport is in Bridge Mode.
    This works nice and became available with the AirPort Express 802.11n, my AirPort Express 802.11g can't do this.
    On the other hand, I'm interesting in connecting some Macs to the "foreign" WLAN, but all the time I use "Join a wireless Network", I got "Internet Connection" with "Connect Using" "Wireless Network" and "Connection Sharing" "Off (Brifge Mode)" only (same with "Extend a wireless network").
    In "Participate in a WDS network" and "WDS remote" the Options for "Connection Sharing" are "Off (Bridge Mode)", "Distribute a range of IP addresses" or "Share a public IP address".
    Maybe I'm wrong, but why I can't use this "Connection Sharing" Options with "Join a wireless Network", the Client Mode, too.
    In the Bridge Mode I can't separate the two networks well.
    Any suggestions,
    Lutz

    The "Connection Sharing" option basically controls the base station's NAT & DHCP functions. By default, Connection Sharing = Share a public IP address. This would enable both NAT & DHCP. When "Distribute a range of IP addresses" is selected, DHCP is enabled, but NAT is disabled. Finally, for "Off (Bridge Mode)," both NAT & DHCP are disabled.
    Now depending on which Connection Sharing option you choose, the options for Wireless Mode will change as well. These are all pre-designed by Apple for the most common uses for their base stations for simplicity.

  • Mail repeats characters in heading lines

    Hi
    since I upgraded to Leopard Mail.app started with this strange behavior: I can enter only one address per line. When I try to enter a second one, it starts repeating the characters I enter in sequence. For instance, if I try to enter the word "Peter" what I get is "ppepetpetepeter" (which is, by the way ppe+pet+pepepeter). It's like if when I enter one character the system copies it and enters it again together with the next.
    Besides, I cannot delete these strange characters. The only way to remove them is to select and copy them.
    I've found this same behavior in other apps. For instance, in the tagging line of Leap.
    In Address Book is even worse. It does the same thing but in the end doesn't let me save the changes to any address.
    I have all the system upgrades, and a previous generation iMac.
    Does anyone has a clue about what's causing this?
    Thanx in advance
    João

    J.
    In the original User Account, try quitting Mail, and then in the Finder open Home/Library/Preferences and find the com.apple.mail.plist file and delete it. Then relaunch Mail and set your accounts up again, and decline to import anything. Mail should then rediscover your account folders.
    Removing the com.apple.mail.plist file will not threaten the contents of your On My Mac mailboxes (which are in the Mailboxes folder and not any account folder). However, for complete safety make a duplicate of either the Mailboxes folder or the entire Mail folder, and temporarily keep that copy on your Desktop for backup.
    Ernie

Maybe you are looking for

  • Preflight icon like Links icon

    Hi! Since preflight work on a regular basis in the background it would have been nice to preflight status was indicated by facility. As a result, the mock-ups I could immediately see the faults such as incorrect colors, image scaling beyond the norm

  • Short dump while running OLI3BW

    Hello, I'm getting a runtime error and a short dump  when I try to fill the setup tables for Purchasing. This is the error mesage: Error in ABAP application program.                                                                                The c

  • ANALOG AUDIO CAPTURE NEEDS RENDERING?

    I am capturing analog VHSC tapes via a Sony HVR-M25U to do the A/D conversion. My inport settings are standard DV using DVCPRO. When I add my captured footage to the timeline, I see the red rendering line and I hear the blips as I playback, after ren

  • Sales Order in Portal?

    Hi expert,   Does anyone have Sales Order application in Portal?   I would like to know if you are able to navigate to summary page for Sales Order.   Steps: Search for a Sales Order, select it, click 'Goto' button --> Summary.   this is urgent, plea

  • Can't get my computer to stop crashing in Firefox, happening constantly!!

    My computer has been constantly crashing for about the last week (20 or more times a day). I run an eBay business from home and am losing very valuable time and money. Needless to say, I am getting very mad and angry since I have had virtually no tro