Introduction to regular expressions ... last part.

Continued from Introduction to regular expressions ... continued., here's the third and final part of my introduction to regular expressions. As always, if you find mistakes or have examples that you think could be solved through regular expressions, please post them.
Having fun with regular expressions - Part 3
In some cases, I may have to search for different values in the same column. If the searched values are fixed, I can use the logical OR operator or the IN clause, like in this example (using my brute force data generator from part 2):
SELECT data
  FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
WHERE data IN ('abc', 'xyz', '012');There are of course some workarounds as presented in this asktom thread but for a quick solution, there's of course an alternative approach available. Remember the "|" pipe symbol as OR operator inside regular expressions? Take a look at this:
SELECT data
  FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
WHERE REGEXP_LIKE(data, '^(abc|xyz|012)$')
;I can even use strings composed of values like 'abc, xyz ,  012' by simply using another regular expression to replace "," and spaces with the "|" pipe symbol. After reading part 1 and 2 that shouldn't be too hard, right? Here's my "thinking in regular expression": Replace every "," and 0 or more leading/trailing spaces.
Ready to try your own solution?
Does it look like this?
SELECT data
  FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
WHERE REGEXP_LIKE(data, '^(' || REGEXP_REPLACE('abc, xyz ,  012', ' *, *', '|') || ')$')
;If I wouldn't use the "^" and "$" metacharacter, this SELECT would search for any occurence inside the data column, which could be useful if I wanted to combine LIKE and IN clause. Take a look at this example where I'm looking for 'abc%', 'xyz%' or '012%' and adding a case insensitive match parameter to it:
SELECT data
  FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
WHERE REGEXP_LIKE(data, '^(abc|xyz|012)', 'i')
; An equivalent non regular expression solution would have to look like this, not mentioning other options with adding an extra "," and using the INSTR function:
SELECT data
  FROM (SELECT data, LOWER(DATA) search
          FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
WHERE search LIKE 'abc%'
    OR search LIKE 'xyz%'
    OR search LIKE '012%'
SELECT data
  FROM (SELECT data, SUBSTR(LOWER(DATA), 1, 3) search
          FROM TABLE(regex_utils.gen_data('abcxyz012', 4))
WHERE search IN ('abc', 'xyz', '012')
;  I'll leave it to your imagination how a complete non regular example with 'abc, xyz ,  012' as search condition would look like.
As mentioned in the first part, regular expressions are not very good at formatting, except for some selected examples, such as phone numbers, which in my demonstration, have different formats. Using regular expressions, I can change them to a uniform representation:
WITH t AS (SELECT '123-4567' phone
             FROM dual
            UNION
           SELECT '01 345678'
             FROM dual
            UNION
           SELECT '7 87 8787'
             FROM dual
SELECT t.phone, REGEXP_REPLACE(REGEXP_REPLACE(phone, '[^0-9]'), '(.{3})(.*)', '(\1)-\2')
  FROM t
;First, all non digit characters are beeing filtered, afterwards the remaining string is put into a "(xxx)-xxxx" format, but not cutting off any phone numbers that have more than 7 digits. Using such a conversion could also be used to check the validity of entered data, and updating the value with a uniform format afterwards.
Thinking about it, why not use regular expressions to check other values about their formats? How about an IP4 address? I'll do this step by step, using 127.0.0.1 as the final test case.
First I want to make sure, that each of the 4 parts of an IP address remains in the range between 0-255. Regular expressions are good at string matching but they don't allow any numeric comparisons. What valid strings do I have to take into consideration?
Single digit values: 0-9
Double digit values: 00-99
Triple digit values: 000-199, 200-255 (this one will be the trickiest part)
So far, I will have to use the "|" pipe operator to match all of the allowed combinations. I'll use my brute force generator to check if my solution works for a single value:
SELECT data
  FROM TABLE(regex_utils.gen_data('0123456789', 3))
WHERE REGEXP_LIKE(data, '^(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})$') 
; More than 255 records? Leading zeros are allowed, but checking on all the records, there's no value above 255. First step accomplished. The second part is to make sure, that there are 4 such values, delimited by a "." dot. So I have to check for 0-255 plus a dot 3 times and then check for another 0-255 value. Doesn't sound to complicated, does it?
Using first my brute force generator, I'll check if I've missed any possible combination:
SELECT data
  FROM TABLE(regex_utils.gen_data('03.', 15))
WHERE REGEXP_LIKE(data,
                   '^((25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})$'
;  Looks good to me. Let's check on some sample data:
WITH t AS (SELECT '127.0.0.1' ip
             FROM dual
            UNION 
           SELECT '256.128.64.32'
             FROM dual            
SELECT t.ip
  FROM t WHERE REGEXP_LIKE(t.ip,
                   '^((25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]{1,2})$'
;  No surprises here. I can take this example a bit further and try to format valid addresses to a uniform representation, as shown in the phone number example. My goal is to display every ip address in the "xxx.xxx.xxx.xxx" format, using leading zeros for 2 and 1 digit values.
Regular expressions don't have any format models like for example the TO_CHAR function, so how could this be achieved? Thinking in regular expressions, I first have to find a way to make sure, that each single number is at least three digits wide. Using my example, this could look like this:
WITH t AS (SELECT '127.0.0.1' ip
             FROM dual
SELECT t.ip, REGEXP_REPLACE(t.ip, '([0-9]+)(\.?)', '00\1\2')
  FROM t
;  Look at this: leading zeros. However, that first value "00127" doesn't look to good, does it? If you thought about using a second regular expression function to remove any excess zeros, you're absolutely right. Just take the past examples and think in regular expressions. Did you come up with something like this?
WITH t AS (SELECT '127.0.0.1' ip
             FROM dual
SELECT t.ip, REGEXP_REPLACE(REGEXP_REPLACE(t.ip, '([0-9]+)(\.?)', '00\1\2'),
                            '[0-9]*([0-9]{3})(\.?)', '\1\2'
  FROM t
;  Think about the possibilities: Now you can sort a table with unformatted IP addresses, if that is a requirement in your application or you find other values where you can use that "trick".
Since I'm on checking INET (internet) type of values, let's do some more, for example an e-mail address. I'll keep it simple and will only check on the
"[email protected]", "[email protected]" and "[email protected]" format, where x represents an alphanumeric character. If you want, you can look up the corresponding RFC definition and try to build your own regular expression for that one.
Now back to this one: At least one alphanumeric character followed by an "@" at sign which is followed by at least one alphanumeric character followed by a "." dot and exactly 3 more alphanumeric characters or 2 more characters followed by a "." dot and another 2 characters. This should be an easy one, right? Use some sample e-mail addresses and my brute force generator, you should be able to verify your solution.
Here's mine:
SELECT data
  FROM TABLE(regex_utils.gen_data('a1@.', 9))
WHERE REGEXP_LIKE(data, '^[[:alnum:]]+@[[:alnum:]]+(\.[[:alnum:]]{3,4}|(\.[[:alnum:]]{2}){2})$', 'i'); Checking on valid domains, in my opinion, should be done in a second function, to keep the checks by itself simple, but that's probably a discussion about readability and taste.
How about checking a valid URL? I can reuse some parts of the e-mail example and only have to decide what type of URLs I want, for example "http://", "https://" and "ftp://", any subdomain and a "/" after the domain. Using the case insensitive match parameter, this shouldn't take too long, and I can use this thread's URL as a test value. But take a minute to figure that one out for yourself.
Does it look like this?
WITH t AS (SELECT 'Introduction to regular expressions ... last part. URL
             FROM dual
            UNION
           SELECT 'http://x/'
             FROM dual
SELECT t.URL
  FROM t
WHERE REGEXP_LIKE(t.URL, '^(https*|ftp)://(.+\.)*[[:alnum:]]+(\.[[:alnum:]]{3,4}|(\.[[:alnum:]]{2}){2})/', 'i')
Update: Improvements in 10g2
All of you, who are using 10g2 or XE (which includes some of 10g2 features) may want to take a look at several improvements in this version. First of all, there are new, perl influenced meta characters.
Rewriting my example from the first lesson, the WHERE clause would look like this:
WHERE NOT REGEXP_LIKE(t.col1, '^\d+$')Or my example with searching decimal numbers:
'^(\.\d+|\d+(\.\d*)?)$'Saves some space, doesn't it? However, this will only work in 10g2 and future releases.
Some of those meta characters even include non matching lists, for example "\S" is equivalent to "[^ ]", so my example in the second part could be changed to:
SELECT NVL(LENGTH(REGEXP_REPLACE('Having fun with regular expressions', '\S')), 0)
  FROM dual
  ;Other meta characters support search patterns in strings with newline characters. Just take a look at the link I've included.
Another interesting meta character is "?" non-greedy. In 10g2, "?" not only means 0 or 1 occurrence, it means also the first occurrence. Let me illustrate with a simple example:
SELECT REGEXP_SUBSTR('Having fun with regular expressions', '^.* +')
  FROM dual
  ;This is old style, "greedy" search pattern, returning everything until the last space.
SELECT REGEXP_SUBSTR('Having fun with regular expressions', '^.* +?')
  FROM dual
  ;In 10g2, you'd get only "Having " because of the non-greedy search operation. Simulating that behavior in 10g1, I'd have to change the pattern to this:
SELECT REGEXP_SUBSTR('Having fun with regular expressions', '^[^ ]+ +')
  FROM dual
  ;Another new option is the "x" match parameter. It's purpose is to ignore whitespaces in the searched string. This would prove useful in ignoring trailing/leading spaces for example. Checking on unsigned integers with leading/trailing spaces would look like this:
SELECT REGEXP_SUBSTR(' 123 ', '^[0-9]+$', 1, 1, 'x')
  FROM dual
  ;However, I've to be careful. "x" would also allow " 1 2 3 " to qualify as valid string.
I hope you enjoyed reading this introduction and hope you'll have some fun with using regular expressions.
C.
Fixed some typos ...
Message was edited by:
cd
Included 10g2 features
Message was edited by:
cd

Can I write this condition with only one reg expr in Oracle (regexp_substr in my example)?I meant to use only regexp_substr in select clause and without regexp_like in where clause.
but for better understanding what I'd like to get
next example:
a have strings of two blocks separated by space.
in the first block 5 symbols of [01] in the second block 3 symbols of [01].
In the first block it is optional to meet one (!), in the second block it is optional to meet one (>).
The idea is to find such strings with only one reg expr using regexp_substr in the select clause, so if the string does not satisfy requirments should be passed out null in the result set.
with t as (select '10(!)010 10(>)1' num from dual union all
select '1112(!)0 111' from dual union all --incorrect because of '2'
select '(!)10010 011' from dual union all
select '10010(!) 101' from dual union all
select '10010 100(>)' from dual union all
select '13001 110' from dual union all -- incorrect because of '3'
select '100!01 100' from dual union all --incorrect because of ! without (!)
select '100(!)1(!)1 101' from dual union all -- incorrect because of two occurencies of (!)
select '1001(!)10 101' from dual union all --incorrect because of length of block1=6
select '1001(!)10 1011' from dual union all) --incorrect because of length of block2=4
select '10110 1(>)11(>)0' from dual union all)--incorrect because of two occurencies of (>)
select '1001(>)1 11(!)0' from dual)--incorrect because (!) and (>) are met not in their blocks
--end of test data

Similar Messages

  • Introduction to regular expressions ... continued.

    After some very positive feedback from Introduction to regular expressions ... I'm now continuing on this topic for the interested audience. As always, if you have questions or problems that you think could be solved through regular expression, please post them.
    Having fun with regular expressions - Part 2
    Finishing my example with decimal numbers, I thought about a method to test regular expressions. A question from another user who was looking for a way to show all possible combinations inspired me in writing a small package.
    CREATE OR REPLACE PACKAGE regex_utils AS
      -- Regular Expression Utilities
      -- Version 0.1
      TYPE t_outrec IS RECORD(
        data VARCHAR2(255)
      TYPE t_outtab IS TABLE OF t_outrec;
      FUNCTION gen_data(
        p_charset IN VARCHAR2 -- character set that is used for generation
      , p_length  IN NUMBER   -- length of the generated
      ) RETURN t_outtab PIPELINED;
    END regex_utils;
    CREATE OR REPLACE PACKAGE BODY regex_utils AS
    -- FUNCTION gen_data returns a collection of generated varchar2 elements
      FUNCTION gen_data(
        p_charset IN VARCHAR2 -- character set that is used for generation
      , p_length  IN NUMBER   -- length of the generated
      ) RETURN t_outtab PIPELINED
      IS
        TYPE t_counter IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
        v_counter t_counter;
        v_exit    BOOLEAN;
        v_string  VARCHAR2(255);
        v_outrec  t_outrec;
      BEGIN
        FOR max_length IN 1..p_length 
        LOOP
          -- init counter loop
          FOR i IN 1..max_length
          LOOP
            v_counter(i) := 1;
          END LOOP;
          -- start data generation loop
          v_exit := FALSE;
          WHILE NOT v_exit
          LOOP
            -- start generation
            v_string := '';
            FOR i IN 1..max_length
            LOOP
              v_string := v_string || SUBSTR(p_charset, v_counter(i), 1);
            END LOOP;
            -- set outgoing record
            v_outrec.data := v_string;
            -- now pipe the result
            PIPE ROW(v_outrec);
            -- increment loop
            <<inc_loop>>
            FOR i IN REVERSE 1..max_length
            LOOP
              v_counter(i) := v_counter(i) + 1;     
              IF v_counter(i) > LENGTH(p_charset) THEN
                 IF i > 1 THEN
                    v_counter(i) := 1;
                 ELSE
                    v_exit := TRUE;  
                 END IF;
              ELSE
                 -- no further processing required
                 EXIT inc_loop;  
              END IF;  
            END LOOP;        
          END LOOP; 
        END LOOP; 
      END gen_data;
    END regex_utils;
    /This package is a brute force string generator using all possible combinations of a characters in a string up to a maximum length. Together with the regular expressions, I can now show what combinations my solution would allow to pass. But see for yourself:
    SELECT *
      FROM (SELECT data col1
              FROM TABLE(regex_utils.gen_data('+-.0', 5))
           ) t
    WHERE REGEXP_LIKE(NVL(REGEXP_SUBSTR(t.col1,
                                         '^([+-]?[^+-]+|[^+-]+[+-]?)$'
                       '^[+-]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)[+-]?$'
    ;You will see some results, which are perfectly valid for my definition of decimal numbers but haven't been mentioned, like '000' or '+.00'. From now on I will also use this package to verify the solutions I'll present to you and hopefully reduce my share of typos.
    Counting and finding certain characters or words in a string can be a tedious task. I'll show you how it's done with regular expressions. I'll start with an easy example, count all spaces in the string "Having fun with regular expressions.":
    SELECT NVL(LENGTH(REGEXP_REPLACE('Having fun with regular expressions', '[^ ]')), 0)
      FROM dual
      ;No surprise there. I'm replacing all characters except spaces with a null string. Since REGEXP_REPLACE assumes a NULL string as replacement argument, I can save on adding a third argument, which would look like this:
    REGEXP_REPLACE('Having fun with regular expressions', '[^ ]', '')So REPLACE will return all the spaces which we can count with the LENGTH function. If there aren't any, I will get a NULL string, which is checked by the NVL function. If you want you can play around by changing the space character to somethin else.
    A variation of this theme could be counting the number of words. Counting spaces and adding 1 to this result could be misleading if there are duplicate spaces. Thanks to regular expressions, I can of course eliminate duplicates.
    Using the old method on the string "Having fun with regular expressions" would return anything but the right number. This is, where Backreferences come into play. REGEXP_REPLACE uses them in the replacement argument, a backslash plus a single digit, like this: '\1'. To reference a string in a search pattern, I have to use subexpressions (remember the round brackets?).
    SELECT NVL(LENGTH(REGEXP_REPLACE('Having  fun  with  regular  expressions', '( )\1*|.', '\1')))
      FROM dual
      ;You may have noticed that I changed from using the "^" as a NOT operator to using the "|" OR operator and the "." any character placeholder. This neat little trick allows to filter all other characters except the one we're looking in the first place. "\1" as backreference is outside of our subexpression since I don't want to count the trailing spaces and is used both in the search pattern and the replacement argument.
    Still I'm not satisfied with this: What about leading/trailing blanks, what if there are any special characters, numbers, etc.? Finally, it's time to only count words. For the purpose of this demonstration, I define a word as one or more consecutive letters. If by now you're already thinking in regular expressions, the solution is not far away. One hint: you may want to check on the "i" match parameter which allows for case insensitive search. Another one: You won't need a back reference in the search pattern this time.
    Let's compare our solutions than, shall we?
    SELECT NVL(LENGTH(REGEXP_REPLACE('Having  fun  with  regular  expressions.  !',
                                     '([a-z])+|.', '\1', 1, 0, 'i')), 0)
      FROM dual;This time I don't use a backreference, the "+" operator (remember? 1 or more) will suffice. And since I want to count the occurences, not the letters, I moved the "+" meta character outside of the subexpression. The "|." trick again proved to be useful.
    Case insensitive search does have its merits. It will only search but not transform the any found substring. If I want, for example, extract any occurence of the word fun, I'll just use the "i" match parameter and get this substring, whether it's written as "Fun", "FUN" or "fun". Can be very useful if you're looking for example for names of customers, streets, etc.
    Enough about counting, how about finding? What if I want to know the last occurence of a certain character or string, for example the postition of the last space in this string "Where is the last space?"?
    Addendum: Thanks to another forum member, I should mention that using the INSTR function can do a reverse search by itself.[i]
    WITH t AS (SELECT 'Where is the last space?' col1
                 FROM dual)
    SELECT INSTR(col1, ' ', -1)
      FROM DUAL;Now regular expressions are powerful, but there is no parameter that allows us to reverse the search direction. However, remembering that we have the "$" meta character that means (until the) end of string, all I have to do is use a search pattern that looks for a combination of space and non-space characters including the end of a string. Now compare the REGEXP_INSTR function to the previous solution:
    SELECT REGEXP_INSTR(t.col1, ' [^ ]*$')                       
      FROM t;So in this case, it'll remain a matter of taste what you want to use. If the search pattern has to look for the last occurrence of another regular expression, this is the way to solve such a requirement.
    One more thing about backreferences. They can be used for a sort of primitive "string swapping". If for example you have to transform column values like swapping first and last name, backreferenc is your friend. Here's an example:
    SELECT REGEXP_REPLACE('John Doe', '^(.*) (.*)$', '\2, \1')
      FROM dual
      ;What about middle names, for example 'John J. Doe'? Look for yourself, it still works.
    You can even use that for strings with delimiters, for example reversing delimited "fields" like in this string '10~20~30~40~50' into '50~40~30~20~10'. Using REVERSE, I would get '05~04~03~02~01', so there has to be another way. Using backreferences however is limited to 9 subexpressions, which limits the following solution a bit, if you need to process strings with more than 9 fields. If you want, you can think this example through and see if your solution matches mine.
    SELECT REGEXP_REPLACE('10~20~30~40~50',
                          '^(.*)~(.*)~(.*)~(.*)~(.*)$',
                          '\5~\4~\3~\2~\1'
      FROM dual;After what you've learned so far, that wasn't too hard, was it? Enough for now ...
    Continued in Introduction to regular expressions ... last part..
    C.
    Fixed some typos and a flawed example ...
    cd

    Thank you very much C. Awaiting other parts.... keep going.
    One german typo :-)
    I'm replacing all characters except spaces mit anull string.I received a functional spec from my Dutch analyst in which it is written
    tnsnames voor EDWH:
    PCESCRD1 = (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
                                                   (HOST=blah.blah.blah.com)
                                                   (PORT=5227)))
               (CONNECT_DATA=(SID=pcescrd1)))
    db user: BW_I2_VIEWER  / BW_I2_VIEWER_SCRD1Had to look for translators.
    Cheers
    Sarma.

  • Introduction to regular expressions part4

    from Introduction to regular expressions ... last part.
    Hi cd_2.
    You has not introduced 11gR1 regex new features.
    Therefore I will introduce it B-)
    RegExp_Count
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions145.htm
    Since Oracle11gR1 There is new function RegExp_Count
    RegExp_Count counts how many strings which has match pattern.
    sampleSQL
    select
    RegExp_Count('abc','[a-c]') as cnt1,
    RegExp_Count('abc','[ac]')  as cnt2,
    RegExp_Count('abc','[0-9]') as cnt3
    from dual;
    cnt1  cnt2  cnt3
       3     2     0***********************************************************************************
    6th parameter of RegExp_SubStr
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions148.htm
    Since Oracle11gR1 There is new 6th parameter at RegExp_SubStr.
    This 6th parameter can emulate regex Lookahead and lookbehind.
    but This can emulate easy case only.
    for ex (?=.*abc)ghi can emulate.
    But (?=.*abc)(?=.*def)ghi cannot emulate.
    sampleSQL
    select
    RegExp_Substr('abc1def2','([a-z])[0-9]',1,1,null,1)
    as "emulate [a-z](?=[0-9])",
    RegExp_Substr('1def2','[a-z]([0-9])',1,1,null,1)
    as "emulate (?<=[a-z])[0-9]"
    from dual;
    e  e
    c  2

    This function has been known to the community for years. It has been presented at conferences by Tom Kyte, discussed in Oracle Magazine, and demonstrated in Morgan's Library on the Regular Expressions page for several years at least.
    http://www.morganslibrary.org/reference/regexp.html
    http://www.morganslibrary.org/reference/builtin_functions.html
    It is a little late to be introducing it. ;)

  • Introduction to regular expressions ...

    I'm well aware that there are already some articles on that topic, some people asked me to share some of my knowledge on this topic. Please take a look at this first part and let me know if you find this useful. If yes, I'm going to continue on writing more parts using more and more complicated expressions - if you have questions or problems that you think could be solved through regular expression, please post them.
    Introduction
    Oracle has always provided some character/string functions in its PL/SQL command set, such as SUBSTR, REPLACE or TRANSLATE. With 10g, Oracle finally gave us, the users, the developers and of course the DBAs regular expressions. However, regular expressions, due to their sometimes cryptic rules, seem to be overlooked quite often, despite the existence of some very interesing use cases. Beeing one of the advocates of regular expression, I thought I'll give the interested audience an introduction to these new functions in several installments.
    Having fun with regular expressions - Part 1
    Oracle offers the use of regular expression through several functions: REGEXP_INSTR, REGEXP_SUBSTR, REGEXP_REPLACE and REGEXP_LIKE. The second part of each function already gives away its purpose: INSTR for finding a position inside a string, SUBSTR for extracting a part of a string, REPLACE for replacing parts of a string. REGEXP_LIKE is a special case since it could be compared to the LIKE operator and is therefore usually used in comparisons like IF statements or WHERE clauses.
    Regular expressions excel, in my opinion, in search and extraction of strings, using that for finding or replacing certain strings or check for certain formatting criterias. They're not very good at formatting strings itself, except for some special cases I'm going to demonstrate.
    If you're not familiar with regular expression, you should take a look at the definition in Oracle's user guide Using Regular Expressions With Oracle Database, and please note that there have been some changes and advancements in 10g2. I'll provide examples, that should work on both versions.
    Some of you probably already encountered this problem: checking a number inside a string, because, for whatever reason, a column was defined as VARCHAR2 and not as NUMBER as one would have expected.
    Let's check for all rows where column col1 does NOT include an unsigned integer. I'll use this SELECT for demonstrating different values and search patterns:
    WITH t AS (SELECT '456' col1
                 FROM dual
                UNION
               SELECT '123x'
                 FROM dual
                UNION  
               SELECT 'x123'
                 FROM dual
                UNION 
               SELECT 'y'
                 FROM dual
                UNION 
               SELECT '+789'
                 FROM dual
                UNION 
               SELECT '-789'
                 FROM dual
                UNION 
               SELECT '159-'
                 FROM dual
                UNION 
               SELECT '-1-'
                 FROM dual
    SELECT t.col1
      FROM t
    WHERE NOT REGEXP_LIKE(t.col1, '^[0-9]+$')
    ;Let's take a look at the 2nd argument of this REGEXP function: '^[0-9]+$'. Translated it would mean: start at the beginning of the string, check if there's one or more characters in the range between '0' and '9' (also called a matching character list) until the end of this string. "^", "[", "]", "+", "$" are all Metacharacters.
    To understand regular expressions, you have to "think" in regular expressions. Each regular expression tries to "fit" an available string into its pattern and returns a result beeing successful or not, depending on the function. The "art" of using regular expressions is to construct the right search pattern for a certain task. Using functions like TRANSLATE or REPLACE did already teach you using search patterns, regular expressions are just an extension to this paradigma. Another side note: most of the search patterns are placeholders for single characters, not strings.
    I'll take this example a bit further. What would happen if we would remove the "$" in our example? "$" means: (until the) end of a string. Without this, this expression would only search digits from the beginning until it encounters either another character or the end of the string. So this time, '123x' would be removed from the SELECTION since it does fit into the pattern.
    Another change: we will keep the "$" but remove the "^". This character has several meanings, but in this case it declares: (start from the) beginning of a string. Without it, the function will search for a part of a string that has only digits until the end of the searched string. 'x123' would now be removed from our selection.
    Now there's a question: what happens if I remove both, "^" and "$"? Well, just think about it. We now ask to find any string that contains at least one or more digits, so both '123x' and 'x123' will not show up in the result.
    So what if I want to look for signed integer, since "+" is also used for a search expression. Escaping is the name of the game. We'll just use '^\+[0-9]+$' Did you notice the "\" before the first "+"? This is now a search pattern for the plus sign.
    Should signed integers include negative numbers as well? Of course they should, and I'll once again use a matching character list. In this list, I don't need to do escaping, although it is possible. The result string would now look like this: '^[+-]?[0-9]+$'. Did you notice the "?"? This is another metacharacter that changes the placeholder for plus and minus to an optional placeholder, which means: if there's a "+" or "-", that's ok, if there's none, that's also ok. Only if there's a different character, then again the search pattern will fail.
    Addendum: From this on, I found a mistake in my examples. If you would have tested my old examples with test data that would have included multiple signs strings, like "--", "-+", "++", they would have been filtered by the SELECT statement. I mistakenly used the "*" instead of the "?" operator. The reason why this is a bad idea, can also be found in the user guide: the "*" meta character is defined as 0 to multiple occurrences.
    Looking at the values, one could ask the question: what about the integers with a trailing sign? Quite simple, right? Let's just add another '[+-] and the search pattern would look like this: '^[+-]?[0-9]+[+-]?$'.
    Wait a minute, what happened to the row with the column value "-1-"?
    You probably already guessed it: the new pattern qualifies this one also as a valid string. I could now split this pattern into several conditions combined through a logical OR, but there's something even better: a logical OR inside the regular expression. It's symbol is "|", the pipe sign.
    Changing the search pattern again to something like this '^[+-]?[0-9]+$|^[0-9]+[+-]?$' [1] would return now the "-1-" value. Do I have to duplicate the same elements like "^" and "$", what about more complicated, repeating elements in future examples? That's where subexpressions/grouping comes into play. If I want only certain parts of the search pattern using an OR operator, we can put those inside round brackets. '^([+-]?[0-9]+|[0-9]+[+-]?)$' serves the same purpose and allows for further checks without duplicating the whole pattern.
    Now looking for integers is nice, but what about decimal numbers? Those may be a bit more complicated, but all I have to do is again to think in (meta) characters. I'll just use an example where the decimal point is represented by ".", which again needs escaping, since it's also the place holder in regular expressions for "any character".
    Valid decimals in my example would be ".0", "0.0", "0.", "0" (integer of course) but not ".". If you want, you can test it with the TO_NUMBER function. Finding such an unsigned decimal number could then be formulated like this: from the beginning of a string we will either allow a decimal point plus any number of digits OR at least one digits plus an optional decimal point followed by optional any number of digits. Think about it for a minute, how would you formulate such a search pattern?
    Compare your solution to this one:
    '^(\.[0-9]+|[0-9]+(\.[0-9]*)?)$'
    Addendum: Here I have to use both "?" and "*" to make sure, that I can have 0 to many digits after the decimal point, but only 0 to 1 occurrence of this substrings. Otherwise, strings like "1.9.9.9" would be possible, if I would write it like this:
    '^(\.[0-9]+|[0-9]+(\.[0-9]*)*)$'Some of you now might say: Hey, what about signed decimal numbers? You could of course combine all the ideas so far and you will end up with a very long and almost unreadable search pattern, or you start combining several regular expression functions. Think about it: Why put all the search patterns into one function? Why not split those into several steps like "check for a valid decimal" and "check for sign".
    I'll just use another SELECT to show what I want to do:
    WITH t AS (SELECT '0' col1
                 FROM dual
                UNION
               SELECT '0.' 
                 FROM dual
                UNION
               SELECT '.0' 
                 FROM dual
                UNION
               SELECT '0.0' 
                 FROM dual
                UNION
               SELECT '-1.0' 
                 FROM dual
                UNION
               SELECT '.1-' 
                 FROM dual
                UNION
               SELECT '.' 
                 FROM dual
                UNION
               SELECT '-1.1-' 
                 FROM dual
    SELECT t.*
      FROM t
    ;From this select, the only rows I need to find are those with the column values "." and "-1.1-". I'll start this with a check for valid signs. Since I want to combine this with the check for valid decimals, I'll first try to extract a substring with valid signs through the REGEXP_SUBSTR function:
    NVL(REGEXP_SUBSTR(t.col1, '^([+-]?[^+-]+|[^+-]+[+-]?)$'), ' ')Remember the OR operator and the matching character collections? But several "^"? Some of the meta characters inside a search pattern can have different meanings, depending on their positions and combination with other meta characters. In this case, the pattern translates into: from the beginning of the string search for "+" or "-" followed by at least another character that is not "+" or "-". The second pattern after the "|" OR operator does the same for a sign at the end of the string.
    This only checks for a sign but not if there also only digits and a decimal point inside the string. If the search string fails, for example when we have more than one sign like in the "-1.1-", the function returns NULL. NULL and LIKE don't go together very well, so we'll just add NVL with a default value that tells the LIKE to ignore this string, in this case a space.
    All we have to do now is to combine the check for the sign and the check for a valid decimal number, but don't forget an option for the signs at the beginning or end of the string, otherwise your second check will fail on the signed decimals. Are you ready?
    Does your solution look a bit like this?
    WHERE NOT REGEXP_LIKE(NVL(REGEXP_SUBSTR(t.col1,
                               '^([+-]?[^+-]+|[^+-]+[+-]?)$'),
                           '^[+-]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)[+-]?$'
                          )Now the optional sign checks in the REGEXP_LIKE argument can be added to both ends, since the SUBSTR won't allow any string with signs on both ends. Thinking in regular expression again.
    Continued in Introduction to regular expressions ... continued.
    C.
    Fixed some embarrassing typos ... and mistakes.
    cd

    Excellent write up CD. Very nice indeed. Hopefully you'll be completing parts 2 and 3 some time soon. And with any luck, your article will encourage others to do the same....I know there's a few I'd like to see and a few I'd like to have a go at writing too :-)

  • Oracle regular expressions REGEXP_SUBSTR

    Hi,
    I'm relatively new here and this is might be a kind of silly.
    Start using reg expressiona and do not know how to get the second pattern from the end (7 in this case)?
    select REGEXP_SUBSTR('1/2/3/4/5/6/7/8' ,'[^/]+$',1, 1),
    REGEXP_SUBSTR('1/2/3/4/5/6/7/8' ,'[^/]+$',1, 2),
    REGEXP_SUBSTR('1/2/3/4/5/6/7/8' ,'[^/]+$')
    from dual;
    Please help.
    Edited by: lsy_nn on Jul 21, 2010 1:51 PM

    RegExp_Replace is useful ;-)
    Let us read these threads.
    I have created part4 :8}
    Introduction to regular expressions part1 to part4
    Introduction to regular expressions ...
    Introduction to regular expressions ... continued.
    Introduction to regular expressions ... last part.
    Introduction to regular expressions part4
    col extStr for a10
    select
    RegExp_Replace('1/2/3/4/5/6/7/8',
                   '^.*([^/]+)/.*$',
                   '\1') as extStr
    from dual;
    EXTSTR
    7

  • Query help in regular expression

    Hi all,
    SELECT * FROM emp11
    WHERE INSTR(ENAME,'A',1,2) >0;
    Please let me know the equivalent query using regular expressions.
    i have tried this after going through oracle regular expressions documentation.
    SELECT * FROM emp11
    WHERE regexp_LIKE(ename,'A{2}')
    Any help in this regard would be highly appreciated .
       Thanks,
    P Prakash

    please go here
    Introduction to regular expressions ...
    Thanks,
    P Prakash

  • Regular expressions in 10g

    Can any body provide good Oracle 10g regular expression tutorial with example link ?

    Here below links from nice post entries from cd :
    Introduction to regular expressions ...
    Introduction to regular expressions ... continued.
    Nicolas.

  • 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 - Replace a part of an expression

    Dear All,
    This is not a business requirement, just trying to practice regexp.
    Suppose we want to replace a part of a regular expression from a string. As an example, in the string 'THIS Number 124356 Is to Change.This Number 5 Also', I am trying to replace the last digit of each number with $ sign.
    Output will be
    'THIS Number 12435$ Is to Change.This Number $ Also'.
    Will this be possible using a single regexp_replce?
    Thanks in advance.

    MichaelS wrote:
    I am trying to achieve this using a SINGLE regexp_replace.Here we go:
    SQL> with t as (
    select 'ABC124556def568gh236klJ258' str from dual union all
    select 'THIS Number 124356 Is to Change.This Number 5 Also' str from dual
    select str, regexp_replace(str, '(\d{0,})\d{1}', '\1$') str2
    from t
    STR                                                     STR2                                                  
    ABC124556def568gh236klJ258                              ABC12455$def56$gh23$klJ25$                            
    THIS Number 124356 Is to Change.This Number 5 Also      THIS Number 12435$ Is to Change.This Number $ Also    
    2 rows selected.
    Nice..
    Learning for me ..
    Never thought of usage like {0,} ... kepping the end value OPEN.
    I was trying with \d+?\d, which was not working..

  • I need help renaming a file using regular expressions in Bridge.

    Hi,
    I work at a university, and we are working through files for our Thesis and Dissertations. We have been renaming them to make them more consistent. I am just wondering if there is a regular expression that could help with this process?
    Here is come examples of current file names;
    THESIS 1981 H343G
    Thesis 1981 g996e
    THESIS-1981-A543G
    I don't need to change the actual names of the files. just how they are formatted.
    Proper case on Thesis.
    Hyphens(-) in all white space.
    First letter capital, last letter lowercase on the call no (H343g)
    So the list above should look like;
    Thesis-1981-H343g
    Thesis-1981-G996e
    Thesis-1981-A543g
    I have seen people do some pretty cool things with regular expressions! Any help would be greatly appreciated. Thanks!

    You would be better off using a script to do this as an example as I don't think it would be possible in the Bridge re-name.
    Using ExtendScript Toolkit or a Plain text editor copy the code into either and save it out as Filename.jsx
    This needs to be saved into the correct folder. this is found by going to the preferences in Bridge, selecting Startup Scripts, this will open the folder where the script is to be saved.
    Once this is done close and re-start Bridge.
    To Use: Goto the Tools Menu and select Rename PDFs
    Make sure you test the code with a few copied files into a seperate folder first to make sure it does what you want.
    The script will do all PDF files in the selected folder.
    #target bridge 
    if( BridgeTalk.appName == "bridge" ) { 
    renamePDFs = MenuElement.create("command", "Rename PDFs", "at the end of Tools");
    renamePDFs.onSelect = function () {
    app.document.deselectAll();
    var thumbs = app.document.getSelection("pdf");
    for( var z in thumbs){
    var Name = decodeURI(thumbs[z].spec.name);
    var parts = Name.toLowerCase().replace(/\s/g,'-').match(/(.*)(-)(.*)(-)(.*)(\.pdf)/);
    var NewName = parts[1].replace(/^[a-z]/, function(s){ return s.toUpperCase() });
    NewName += parts[2]+parts[3]+parts[4]+parts[5].toUpperCase().replace(/[A-Z]$/, function(s){ return s.toLowerCase() });
    NewName += parts[6];
    thumbs[z].spec.rename(NewName);

  • Those darn regular expressions again ...

    Greetings,
    I feel reluctant to ask this question because I sincerely hate regular expressions, but here is a regular expression question:
    Suppose I receive a byte stream from a device: after having received a, say, 'X' byte some more bytes follow, followed by a number: two or three digits followedby a dot and then some more digits follow. I am interested in that number so I cooked up this:
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class Test {
         public static void main(String[] args) {
              Pattern pat= Pattern.compile("X.*(\\d{2,3}\\.\\d*)");
              String  str= "fooXbar123.456baz";
              Matcher mat= pat.matcher(str);
              if (mat.find())
                   System.out.println(str.substring(mat.start(1), mat.end(1)));
    }The regular expression represents what I want to see: a capital X, some bytes and the number. b.t.w. I convert those bytes to chars so there is no problem there. The output of this little snippet is "23.456", i.e. it takes the shortest variant of group #1 (the '1' is eaten by the "dot-star" subexpression.
    I hope you understand why I hate those regular expressions so much; they're the devil's invention. My question boils down to: how can I find the longest variant of that group #1 expression? i.e. "123.456".
    A bit more info: the 'bar' part can contain almost anything, including digits. It can even be totally empty. The capital 'X' has to be present and "bar" doesn't contain a capital 'X'.
    kind regards,
    Jos

    JosAH wrote:
    Never did get my head round the 'pimping lemon'!If a word x y z t u is in a language L and if x y^n z t^n u is also in that language the pumping lemma applies and L is a context free language; that is so trivial ... ;-)Was that a low flying jet or just the 'pimping lemon' going straight over my head!
    >
    I used to teach APL to non-(scientists/engineers/mathematicians) . One of the most unsatisfying jobs ever. I love APL but how do you teach APL to someone who does not understand matrices? How do you teach APL to someone who expects 1-1-1-1-1 to be -3? I still get agencies contacting me about APL jobs even though I last used it 25 years ago!I used to program APL on an old DEC LA/36 paper terminal. You had to lean over backwards because those APL symbols were printed on the front side of the keys. Therefore my knees blocked the paper feed so all my printouts turned into a mess ...I was lucky. I used an IBM (5110 springs to mind but at my age!) box and some IBM terminals attached to an IBM370. No silly paper tape. It just cost a fortune for every second one was connected to the IBM370.
    >
    How's the 'limp' Jos? Any better?Not really; I put too much strength on my left leg (the 'good' one) and my body thought something was wrong so it started a bad inflamation in that leg. I'm on inflamation suppressing pills now. dammit.
    We are a real pair of crocks! I mixed and laid 6 ton of concrete and disposed of 8 ton of hardcore during Dec, Jan and Feb. My knee is swollen like a balloon and I'm on anti-inflammatory pills right now. BUT I have to eat a full meal before taking them and that means I have to have to take more pills to suppress my excess stomach acid. God I wish I was 50 again!
    I shall have to visit Holland sometime before we are both confined to wheelchairs.

  • [Regular Expressions] Saving a variable number of matches

    I'm stuck with the following problem and I don't seem to be able to solve without lots of ifs and else's.
    I've got a program that you can pass patterns as parameters to. The program receives patterns as one single string.
    The string could look like this:
    a:i:foo r::bar t:ei:bark
    or like this:
    a:i:foo
    What I'm hinting at is that the string comprises of several parts of the same structure. Each structure can be matched and saved with:
    ([art]:[ei]{0,2}:.*)
    Now I want my regular expression able to match all the occurences without checking the string containing the pattern for something that could indicate the number of structures inside it. The following does not seem to work:
    ([art]:[ei]{0,2}:.*)+
    So now I'm looking for something that would match one or more occurence of the structure and save it for future use.
    I'd be really happy if someone could help me out here
    Last edited by n0stradamus (2012-05-03 20:27:02)

    Procyon wrote:
    --> echo "a:i:foo r::bar t:ei:bark" | sed 's/\([art]:[ei]\{0,2\}:[^ ]*\)/1/'
    1 r::bar t:ei:bark
    --> echo "a:i:foo r::bar t:ei:bark" | sed 's/\([art]:[ei]\{0,2\}:[^ ]*\)/1/g'
    1 1 1
    If [^ ]* is not usable (spaces are allowed arbitrarily), you need a non-greedy .* and non-consuming look-ahead of " [art]:"
    In python's re module, this is .*?(?=( [art]:|$))
    >>> import re
    >>> m=re.findall("([art]:[ei]{0,2}:.*?(?=( [art]:|$)))","a:i:foo r::bar t:ei:bark")
    >>> print(m)
    [('a:i:foo', ' r:'), ('r::bar', ' t:'), ('t:ei:bark', '')]
    Exactly what I was looking for! I didn't know that you could specify .* to stop at a certain sequence of characters.
    Could you please point me to some materials where I can read up on the topic?
    Back to the regex: It works finde in Python, but sadly that is not the language I'm using
    The program I need this for is written in C and until now the regex functions from glibc worked fine for me.
    Have I missed a function similar to re.findall in glibc?

  • Regular Expression Character Sets with Pattern and Matcher

    Hi,
    I am a little bit confused about a regular expressions I am writing, it works in other languages but not in Java.
    The regular expressions is to match LaTeX commands from a file, and is as follows:
    \\begin{command}([.|\n\r\s]*)\\end{command}
    This does not work in Java but does in PHP, C, etc...
    The part that is strange is the . character. If placed as .* it works but if placed as [.]* it doesnt. Does this mean that . cannot be placed in a character range in Java?
    Any help very much appreciated.
    Kind Regards
    Paul Bain

    In PHP it seems that the "." still works as a all character operator inside character classes.
    The regular expression posted did not work, but it does if I do:
    \\begin{command}((.|[\n\r\s])*)?\\end{command}
    Basically what I'm trying to match is a block of LaTeX, so the \\begin{command} and \\end{command} in LaTeX, not regex, although the \\ is a single one in LaTeX. I basically want to match any block which starts with one of those and ends in the end command. so really the regular expression that counts is the bit in the middle, ((.|[\n\r\s])*)?
    Am I right it saying that the "?" will prevent the engine matching the first and last \\bein and \\end in the following example:
    \\begin{command}
    some stuff
    \\end{command}
    \\begin{command}
    some stuff
    \\end{command}

  • Regular Expressions... finding a '('

    Hi guys,
    Been trying for an hour or so now, but i can't seem to find out how to locate a "(" in a regular expression and the usuall break out characters '\\' doesnt seem to work..
    I.e. in the text that I'm searching, the string I want to scrape out may sometimes contain a " ( .* ) " at the end of it, so I've been writing regex's like
    ([A-Z]) ([a-z]*) ([_]?) ([\\([? )    //more follows
    I hope that's clear.. its the last part with the '(' that doesnt work..
    o.0
    ___

    tried the double backslash.. and still doesn't work.. here's the actual regex I'm writing;
    pattern = Pattern.compile("((href=\"/wiki/)([A-Z])([a-z]*)(_)([A-Z])([a-z]*)([A-Z]?)([a-z?]*)([_]?)([\\(]?)", Pattern.MULTILINE);{code}
    Edited by: Mark.ONeill on Jan 2, 2008 12:47 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Regular Expression he!!  =)

    Okay, the regexp needs to dig through an HTML file and print out all the links. Here's what I've got:
    Pattern p = Pattern.compile("a\\shref=\"(.)+\"", Pattern.MULTILINE);
    Matcher m = p.matcher(fileData);
    while (m.find()) {
    System.out.println(m.group() + "\n");
    Yes, I know the regexp I'm using isn't very good to find links, but I'm starting simple. What (I think) the above should match, is "a", followed by a space, followed by "href=", followed by a quote, any text, and another quote.
    I have the text:
    This is a "test"
    What gets printed off for this text is:
    a href="test.html">This is a "test"
    Instead of quitting after the first " it finds, it continues for more. It's not always the third quote either, sometimes it's 5, etc.
    I have no idea why this is occurring. It's either a bad regexp or I'm not utilizing the Java language properly.
    Any help would be greatly appreciated!

    You think you are searching for a (") followed by (some_text) followed immediately by a (").
    But that's not what you are doing...
    Java's Regular expressions are "greedy" by default. This means the (+) operator will take characters until it cannot take anymore. In your case, it is taking all the characturs until the end of your string. Then it looks for a ("), but it cannot find one, because it ate up all the characters. It's at the end of your string. This is because you used a (.), which means any character!!
    Now it is going to back up one character at a time until it finds a (") it can use. Well, it only has to back up one time, because there is a (") at the end of your string. So it takes that (") as it's last part of the match.
    This isn't what you intended...
    You wanted it to start at a quote and keep going until it finds the very next quote. The pattern you should use is something akin to the following:
    a\\s+href=\"([^\"])+\"Now it is saying: start at the first (") and eat everything that is not a ("). Then grab the next (") it finds.
    Note the stuff in the parentheses. I used ([^\"]), which means "anything that is not a ("). This is different from what you had. (.) means "anything at all...including a quote".

Maybe you are looking for

  • How do i change the pop down window size

    hi, my retina macbook pro is usually set at the second to highest option in display size. at one point it was plugged into a 2nd monitor, and now, when it's not, when i'm using an app and want to download or save a file, the dialog window that pops d

  • İnbox and MW Task in one iview

    Hi all, One of our customers want to see his inbox which has R3 Workflow  and his task which has Portal ad hoc workflow in one iview. Is that possible?

  • Multiple BPs for a Sales Oppotunity

    I need to have multiple customers listed for a single Sales Opportunity.  The only two ways I can think of are using multiple opportunities or UDFs.  Does anyone have a preferrence or another suggestion?

  • Gnome-shell segfault when using fglrx

    I have again tried to switch to the proprietary ATI Catalyst drivers as I wanted OpenCL support.  When I attempt to login I get the "Oh no!" error screen. dmesg: [ 33.063458] 2:3:1: cannot get freq at ep 0x82 [ 34.186831] 2:3:1: cannot get freq at ep

  • IPod Touch 5G Wi-Fi Defect?

    I bought today a brand new Silver iPod Touch 5th generation, and I'm having BIG issues maintaining a Wi-Fi connection: My iPod recognized and connected to my Wi-Fi network, so I went to Safari and tried opening various websites and it worked at the b