How get us a word in the regular expression

Hi all

I am new to regular expressions, I did some tests in Google, but not clearly how to reach the scenario below

SELECT *
FROM Icehead tih, head fh
WHERE  tih.head_id = fh.head_id         
AND    UPPER (tih.head) LIKE UPPER ('%WANT%') 

The query above, we check a keyword like "WANT."

-Along with the 'FAULT', we must move to another keyword like 'SHELL '.

-Have you used or condition operator to above query as shown below

SELECT *
FROM Icehead tih, head fh
WHERE  tih.head_id = fh.head_id 
and UPPER (tih.head) LIKE UPPER ('%WANTS%') or UPPER (tih.head) LIKE UPPER ('%SHELL%')

-Instead of use 'or' want to use the regular operator, in the future if any other keyword want to use, then we can send this word using dynamically in the process, could help me on this.

Kind regards

Sruthitamiri

Sruthi Tamiri wrote:

Thanks for your suggestion, I have % in a regular expression, sorry for the same.

One last point after patten 'i' used what I indicate here, can you explain even.

It is a match parameter to specify the corresponding case. Please see the documentation for the basic questions like this.

Tags: Database

Similar Questions

  • I know by logic box to get the output using the regular expression?

    Hello

    I am now only study the notion of Regexp. I had seen the best of Mr. Blus. Can I know how it works. I need this logic of the functionality of wildcards in sting matching Regexp (wildcard string Matching).
    SQL> ed
    Wrote file afiedt.buf
     
      1  WITH test_data AS (
      2  SELECT 'c:\temp\folderA\fileA.txt' t FROM DUAL UNION ALL
      3  SELECT 'c:\temp\fileA.txt' t FROM DUAL UNION ALL
      4  SELECT '\\mymachine\A\fileB.txt' t FROM DUAL UNION ALL
      5  SELECT '\\mymachine\A\B\fileB.txt' t FROM DUAL UNION ALL
      6  SELECT '\\mymachine\A\B\C\image.jpg' t FROM DUAL UNION ALL
      7  SELECT '\\mymachine\A\B\C\D\music.mpg' t FROM DUAL UNION ALL
      8  SELECT 'c:\myfolder\folderD\folderE\4969-A.txt' t FROM DUAL
      9  )
     10  select regexp_replace(t, '^.*[\]([^\]*)[\][^\]*$','\1')
     11* from test_data
    SQL> / 
     
    REGEXP_REPLACE(T,'^.*[\]([^\]*)[\][^\]*$','\1')
    ------------------------------------------------------------------
    folderA
    temp
    A
    B
    C
    D
    folderE
     
    7 rows selected.
     
    SQL>
    Please help me in this matter.

    Iqbal

    Sabrina wrote:
    One last question what is the average of

    The final "\1" in

     select regexp_replace(t, '^.*[\]([^\]*)[\][^\]*$','\1') 
    

    Iqbal

    It is a reference.

    See here:
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14251/adfns_regexp.htm#CHDHCIGH

    and in the middle of the table here:
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14251/adfns_regexp.htm#CHDIEGEI

    Matches the nth previous subexpression, in other words, either grouped in parentheses, where n is an integer between 1 and 9. The parentheses cause > an expression be remembered; a backreference refers to him. A backreference account subexpressions from left to right, starting with the opening > bracket of each subexpression preceding. The expression is not valid if the source string contains less than n subexpressions preceding the \n.

    Oracle supports the expression of backreference in the regular expression pattern and the replacement of the REGEXP_REPLACE function string.
    The expression (abc: def) matches the strings abcxyabc and defxydef xy\1, but does not abcxydef or abcxy.

    A backreference allows you to search for a string repeated without knowing the actual string advance. For example, the expression ^(.*) \1$ > matches a line consisting of two adjacent instances of the same string.

    As explained in table 4-2, backreferences store sub-expressions matched in a temporary buffer, which allows to reposition the characters. You access the pads with the notation \n, where \n is a number between 1 and 9. Each subexpression brackets and is numbered from left to right.

  • How to remove a Word from the default dictionary of firefox?

    How to remove a Word from the default dictionary of firefox?
    If I wanted to remove the word 'dog' or 'and' for example

    There may be a range of reasons for wanting to do this, including the deletion of the words you use rarely as similar to other common spellings used words for example. "minute" and "Minuet", delete the words that you find personally offensive, or removing words that, because of linguistic or cultural background, you would not consider words at all.

    Note that I'm not asking how to remove my 'dictionary' words, words that I added myself.

    Hello

    I talked to a few people and I think I'm able to help you with this.

    There are two dictionary files, the default that comes with your version of Firefox and personal 'custom' that you create yourself with phrases and words.

    If you want to change the personal;

    1. Copy Subject: support and paste into the address bar.
    2. Next to the profile folder, click the marked File Show
    3. Find the file persdict.dat. Rename a text file, open, modify, re save it as persdict.dat and replace.

    If you want to change the default dictionary, it could be more of a problem and a lot more technique to do. I would recommend that you look at the problem differently and consider filtering of pages based on inappropriate content using Add-ons such as ProCon Latte Content Filter.

    I hope this helps, but if not, please come back here and we can look at another solution for you.

  • I have a protected PDF file. I have the password. How to convert to Word?  The export tool will fail because it has a password (even if the doc is open)

    I have a protected PDF file. I have the password. How to convert to Word?  The export tool will fail because it has a password (even if the doc is open)

    Hi stupiddonkey,

    You will need to remove the password from the file (using Acrobat, not reader) before you can convert it to Word. To do this, choose file > properties, and then click the Security tab choose no security in the context menu of the security method and enter the password when you are prompted.

    Best,

    Sara

  • How can I refer to a variable in the regular expression

    Hello friends,

    I have this Regexp, extract the County code: (971)
    Select regexp_replace (regexp_replace ('05-000971 7910-324324', '\D'),'^ 0 * (971)? 0?') of double;
    It is very good and the need...

    But, thinking about the future, someone may need to remove the country code (961), so it is better if I put the code in a variable, but

    How can I list the County code via a variable since the Regexp:
    declare 
    a varchar2 (15);
    code number := 971;
    begin
    select regexp_replace(regexp_replace('000971 05 7910 - 324324','\D'),'^0*(code)?0?') into a from dual;
    dbms_output.put_line ( a);
    end;
    but it does not work?

    Best regards
    Fateh

    You must link the value of the variable code in the regular expression pattern

    
    select regexp_replace(regexp_replace('000971 05 7910 - 324324','\D'),'^0*('||code||')?0?') into a from dual 
    
  • How to pass a variable in a regular Expression.

    Hello

    I'm trying to understand some basics of regular Expressions.
    For just an experience I want to count the words in a string.

    var str:String = Hello, "this is a text to count the word Hello and check if Hello is ignored by the case and if hellow is different."

    var myreg:RegExp = \bhello\b/gi;

    trace (Str.match (myreg));


    Here, I get the array of values. and using his length, I can use the total number. It works, but the regular expression is not dynamic.

    So, I thought that something like that, but that doesn't seem to work

    var flags: String = "ig".

    var password: String = "Hello";

    var model: String = ' / \b'+word;

    var myreg:RegExp = new RegExp (pattern, flags);

    trace (Str.match (myreg)); (does not work)

    Does anybody know a solution for this? Thank you!

    var pattern:String = "\\b" + word + "\\b";
    

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • Analyze the Mac address with the regular expression matching

    Hello world

    I have a problem with the function of regular expression matching,

    I try to analyse the response both a query arp - a 192.168.0.15 to retrieve the MAC address of the remote IP address, I used the following regular expression: ^ ([0-9a-fA-F]{2}[:-]){5}([0-9a-fA-F]{2})$

    I wonder why should I do a subset of the first string to extract only the part of the MAC address. The regular Expression function is not able to recognize the regular expression directly in the middle of a string?

    I only works when I extracted the subset of tring right as in the picture below.

    Thanks for your replies.

    Get rid of the "^" at the beginning of your regular expression. You are ordering him to find the model at the beginning of the string.

  • The regular expression Dilimit

    How can I delimit the regular expression with the number sign (#) and then use an apostrophe in the expression.
    Can someone give some explamples.

    As regular expressions are placed in quotation marks, and I have an apostrophe in a string also how would I be able to specify the regular expression with a sign by dilimiting #.


    Thank you

    Published by: LostWorld Sep 15, 2010 05:40

    Hello

    Not sure I understand the question you are faced with, but I think using q citing might help:

    SQL> with t as (
      2  select 'abcd ''1234''' str from dual)
      3  -- end of sample data
      4  select str, regexp_substr(str, q'#'1234'#') str from t;
    
    STR         STR
    ----------- -----------
    abcd '1234' '1234'
    

    The symbol # now includes the string in the example above.

    You can view the documentation for more information in the link below:
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/sql_elements003.htm

  • Is the function of the regular Expression

    Hi guys, using this model, I got this error:

    -4600 error has occurred during the regular expression match.

    I have attached the VI.

    can you help me? Thank you

    inuyasha84 wrote:

    Hi well I want to save (create) a file and do a check to see if the new file that I want to create already exists or not. If the idea was to see if the path of the new file is equal to the old path

    Why not just use 'check if the file or folder exists? (E/s files-> Adv file functions)

    Cameron

  • The regular expression problem

    Dear friends,

    In my script I have some sections that test the contents of an edit field before it is processed further.

    Perfectly things like the following:

    var re_Def = /#[A-Za-z][A-Za-z0-9_]+/;          // valid variable name ?
    items = ["#correct", "notcorrect", "#This_is4", "#thisIs", "@something", "#ALLOK", "", ];
    // search    0            -1          -1!!        -1!!          -1        -1!!     -1      <--- incorrect method
    // test    true         false         true        true        false       true    false    <--- correct method
    for (var j = 0; j < items.length; j++) {
      var item = items[j];
      alert ("'" + item + "' ==> " +  item.search(re_Def) + "\n" + re_Def.test(item));
    }
    var re_Def = /(\[ROW +\d+\]|\[COL +\d+\]|\[CELL +\d+, +\d+\]|Left *\(\d*\)|Right *\(\d*\)|Above *\(\d*\)|Below *\(\d*\))/;
    items = ["[ROW 17]", "[Row n]", "[ROW n]", "[CELL 3, 9]", "[CELL 3 9]", "Abbove()", "Right(3)"];
    // result  true        false      false         true         false        false         true    
    for (var j = 0; j < items.length; j++) {
      alert ("'" + items[j] + "' ==> " +  re_Def.test(items[j]));
    }
    

    But what follows always returns false, independly of the content of the string element:

    var re_Def = /{[EFJ]\d*}|{I}/;    // valid format def?
    var item = "{E27}";
    var result = re_Def.test(item);
    alert (result);                   // false !!
    

    RegEx buddy told me, that
    -l' REGULAR expression is correct
    -the result must be true, not false

    -The verbose definition of the RegEx is:
    Match is the following regular expression (attempting the next alternative only if this one fails) "{\d* [EYF]}."
    Match the character "{" literally "{}".
    Match a single character present in the list "J" "[EYF]."
    Match a single digit 0. 9 paper"\d*»
    Between zero and unlimited times, as many times as possible, giving as needed (greedy) «*»
    Match the character "}" literally "}".
    Or match number 2 below (the entire match attempt fails if it cannot match) regular expression "{i}".
    Match the characters "{i}" literally "{i}".

    Typo unrecognized? Test the faulty method?

    Results are fake, as soon as I use the list of characters []] - but look at the first block of code: there are also lists of character they are treated properly.

    The braces in the regular expression must be escaped to be taken literally:

    var re_Def = /\{[EFJ]\d*\}/;
    

    Kind regards

    JoH

  • The Regular Expressions and GUID.

    Hello gurus, I hope you can help me!
    I need to select GUID from a table and to do this, I need the regular Expression. My
    Perl is not good and not good Regular Expression. My database is Oralce 11.2.0.2.0 and
    Linux (Oracle Version 6) is the operating system of the Machine. If you need further information,
    I'll look closely. Thank you. Jehangir.

    >

    Hi Jehangir and welcome to the forums.

    I need to select the GUID of a table and to do this,

    Well, the first thing we do is read the forum FAQ and also the post by BluShadow
    at the top of the messages on the home page of the forum. You should have provided code (DDL
    and DML) showing your particular problem, but since it's your first time, I'll be gentle ;)

    We have it done - clients have sometimes GUID as PKs, and we need to send data to
    their systems, but it is not as simple as it may first appear.

    GUID may arise in three formats.

    The Oracle one - SELECT Sys_GUID() from DUAL which is just a string of 32 hexadecimal characters.
    Then the chain with the hyphen, then the string with dashes and {} at the beginning and end (see
    examples of data).

    with datax as
    (
      SELECT '79A864CCD8E44CD8B0A2765DF9EF337B' as guid  FROM DUAL  UNION ALL
      SELECT '79A864CFD8E44CD7B0A2765DF9EF337B' FROM DUAL UNION ALL
      SELECT '8gdfsgsgfdg' FROM DUAL UNION ALL  -- dummy for testing
      SELECT '21EC2020-3AEA-1069-A2DD-08002B30309D' FROM DUAL UNION ALL
      SELECT '21EC5550-3AEA-1069-A2FF-08002B30309D' FROM DUAL UNION All
      SELECT '{21CC2020-3AFA-1A69-A2DD-08002B30309D}' FROM DUAL
    )
    
    -- first one is the Oracle format
    select * from datax where regexp_like(guid, '[0-9a-fA-F]{32}'); -- Oracle select sys_guid();
    
    -- second one is with hyphens
    
    select * from datax where regexp_like(guid, '[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}');
    
    -- third one is with hyphens and curly brackets.
    
    select * from datax where regexp_like(guid, '^\{[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}\}$');
    
    -- This converts both of the last two formats back into Oracle format, which is what
    -- we use. Notice, that I haven't used regualar expressions to do this. Regexes are
    -- computationally expensive, and you should use Oracle's string furnctions if possible
    
    SELECT REPLACE(REPLACE(REPLACE(GUID, '{', ''), '}', ''), '-', '')  FROM Datax;
    

    HTH,

    Paul...

    Jehangir.

  • Sense of the regular expression in detail

    Hi all

    I don't know if this question is to type correct forum but my question is

    What is retail mean more regex? Please help me understand this character by character.

    Expression is ^ [(\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.) + [A - Z] {2,4} $]

    Thank you

    sabre150 wrote:
    In general terms, that the regular expression is a poor attempt to check email address syntax. Very bad because it does not cover the complete specification.

    Yes. And after that: If your application looks at the e-mail address (valid) of someone and told them that this is not an email address valid, they will think you are a fool. And if your application is used for commercial purposes, which would be a black mark against your company. You're better not to validate e-mail addresses to all that the implementation of a solution with false negatives.

  • Form validation helps with the regular Expression [a-zA-Z]

    I'm trying to use the regular expression [a-zA-Z] to allow only upper or lowercase WITHOUT SPACES. With the help of [a-zA-Z] allows space and numbers.

    Could someone give me a point in the right direction?

    Thank you!

    RGNelson wrote:

    I'm trying to use the regular expression [a-zA-Z] to allow only upper or lowercase WITHOUT SPACES. With the help of [a-zA-Z] allows space and numbers.

    Could someone give me a point in the right direction?

    Please try with the following regular expression, which should work for text entry fields 'a line' well standard.

    ^ [A-Za-z] + $

    See you soon,.

    Günter

  • The clob data analysis - helps in the regular Expression

    Hello

    Need to analyze a clob and and get its value.

    with the temp as

    (select '-dn=cn=9245fe4a-d402-451c-b9ed-9c1a04247482,ou=people,dc=idauth-userstore,dc=standardlife,dc=com' as double val)

    Select * Temp;

    "Analysis to include only the characters after ' dn = cn =" and ending with a comma, so I need to value the O/P as feadcbedca


    How to achieve this using regular expressions.


    Also is it a useful site to learn Oracle regular expressions for beginners like me.

    If yes give me the link, it will be useful.


    Thanks in advance

    SQL> with temp
      2  as
      3  (
      4  select '- dn=cn=9245fe4a-d402-451c-b9ed-9c1a04247482,ou=people,dc=idauth-userstore,dc=standardlife,dc=com' as val from dual
      5  )
      6  select regexp_replace(ltrim(regexp_substr(val, 'dn=cn=[^,]+'), 'dn=cn='), '[^[:alpha:]]') val
      7    from temp;
    
    VAL
    ----------
    feadcbedca
    
    SQL>
    
  • The regular Expression disorder

    Hello everyone, happy holidays.

    I create a component in an application that is similar to the function of Facebook's "News Feed". This feature lists the rows of a database that can contain 'special' text to be converted to HTML. Note: I'm store "special text" in the database instead of the HTML real to save space in the database where the object name is very long.

    Here's what I'm trying to do:

    In the database a record might look like this:
    12/25/06 [user: 253] John Smith [a] connected.

    When I display the table I want to convert to the following:
    12/25/06 < a href = "user_info.cfm? userId = 253" > logged in on John Smith < /a >.

    I was able to create the following regular expression, which does a good job of converting the text to a link, but I am unable to get the uniqueID (253) of the string. Note: The Description is the name of the column is being processed.

    < CFSET = temp ReReplace (Description,'-[user:.------] "," < a href = "user_info.cfm? userID = 253" > ', 'ALL') >
    < CFSET = temp ReReplace (temp,'\ [/ a\]', '< /a >', 'ALL') >

    Is there a way I can convert the string into a regular expression? Also, how can I get the number value after the colon (:) and insert it in the replacement string?)

    In addition, to complicate things, the string can have multiple instances of "special text". For example:
    12/25/06 [user: 253] John Smith [a] changed account [user: 262] Captain Picard [a]

    Thanks for your help!

    The (. *) part of your regex can capture more than desired for the following user ID.

    Maybe this will do as you wish.

    -tom-

Maybe you are looking for

  • Playlist bought used to sync properly

    I have an iPhone 6s and since my purchased playlist, start to use the music library to iCloud recently has not been synchronized correctly. I have the playlist bought in a certain order on my computer but the playlist bought on my phone is completely

  • Move HP_Tools

    Hello! I saw in some of the messages people have asked what is 'HP_Tools' partition, and I realized that it's a software partition "help", so it can be deleted, but it is useful... I need to create a new partition to a different OS, so I have to remo

  • MOTOBLUR

    How will I know if my motorola defy has motoblur?

  • my microsoft sidewinder x 8 led went out is there way to maybe fix or should I go to?

    the bottom led works up a is off I had not had this mouse for a long time so it shouldn't have burned.

  • Lightromm freezes? Why

    Lightroom regularly freezes in Woindows 10