Whole word search

I am trying to write a select statement, with a where clause that can search for whole words only. Example, if I do a select statement with where clause like:
where column like '%war%', I want to be able to return rows:
World war.
war of the worlds
this war is bad
but NOT
software
ware
wars
wards...
Is this possible in SQL without the use of Oracle text, if not, how can I use Oracle text or regular expressions to do so?
Thanks in advance,
Sam

This works in 9i
with txt as
(select 'war of the worlds' srch from dual
union all
select 'software' from dual
union all
select 'This is the war' from dual
union all
select 'wards' from dual
select * from txt
where srch like '% war%' or srch like '% war %' or srch >like 'war %'It will not work for the value 'war'
.

Similar Messages

  • Whole-word search in project

    I'm running RH for HTML Help X4.1 on Windows XP. I want to
    search through all the text in all of the topics for a particular
    word or word string. Is that possible? I can't find anything that
    lets me do that? I realize this is NOT Win Help where I'd be
    searching a Word document, but it would be very helpful to be able
    to do a whole-word search of the project. Thanks.
    -david

    Just a word of warning. It is good practice to close your RH
    project down as the in built tool does occasionally fail to spot
    instances in open topics/projects. Personally most authors on here
    prefer to use other tools (e.g.
    FAR or
    BkReplacem).

  • IBooks PDF "whole word" search?

    Hey gang-
    Love the new PDF features in iBooks. I've moved most of my frequently referenced work PDFs to my iBooks library. But iBooks seems to lack a "whole word" search capability. Am I missing something?
    I need to be able search such that a Search for "part" does not also return "particle" or "participle", etc. I tried quotes and that didn't do it. Any way to do this?
    Thanks!
    Dave

    Assuming you are on 10g:
    with t as (
               select 'old county rd' address from dual union all
               select 'old church rd' address from dual union all
               select 'oldie rd' address from dual union all
               select 'Harold rd' address from dual union all
               select 'first street old' address from dual union all
               select 'new old church rd' address from dual union all
               select 'new-old church rd' address from dual union all
               select 'old-new church rd' address from dual
    select  address
      from  t
      where regexp_like(address,'(^|\W)old(\W|$)','i')
    ADDRESS
    old county rd
    old church rd
    first street old
    new old church rd
    new-old church rd
    old-new church rd
    6 rows selected.
    SQL> However, as you can see, the above sql will also return addesses where old is a word in a multipart words (e.g. new-old).
    SY.

  • Whole word search in iBooks

    How does one do a whole word search in iBooks on an iPad? For example, I want to search a PDF for "reset" and not get hits on "preset" in the search results.
    Thanks.
    Mike

    Just a word of warning. It is good practice to close your RH
    project down as the in built tool does occasionally fail to spot
    instances in open topics/projects. Personally most authors on here
    prefer to use other tools (e.g.
    FAR or
    BkReplacem).

  • Search for a whole word fails if word in text is preceeded by "-"

    Hallo there,
    I discovered a new "feature" by Adobe Reader. When I search for a Whole word, and if a word is preceeded by a "-" it lists it, although it shouldnt.
    For example. Serached word : "Word".
    In the results you will find something like "Wrongly-found-word, Wrongly-listed-word" etc.
    How to exclude those cases ?
    Thanks in advance,
    B

    Btw, maybe such whole word search is possible only with a regular expression?
    Other exampels
    Word to search for : "X"
    Results could be also: "Y-X-Z", "Y-Z-X', "X-Y-Z".
    All I would like to have is aber only when "X" is preceeded and succeeded by a space character, or in best case by a single, non-letter, non-digit character.
    I will appreciate any helpful advice, how to search and find a whole word only.
    Regards,

  • How do you perform partial word search using PDF Open Parameters?

    Hello,
    We are using the 'search=' open parameter in the URL string, which open a PDF and automatically searches for a word within the PDF.  It works great for whole word searches. Unfortunately, it does not work for partial word, or phrases. In other words, if I'm searching on '123456' and there is a word in the document that is '1234567', it will not find the partial word, or first 6 characters of the 7 character word. You can perform a partial or phrased search using the advance search feature of Adobe Reader.  So, currently after the PDF opens, and shows no hits on the automatic search for '123456', we are able to manually search again for a partial word search, and then see matches in the document.  Is there any way to specify to use a whole or partial word search when using the 'search=' open parameter, so that we can automatically match on partial and whole words?  Something like 'search=123456*'?

    It never worked that way. Command-F shows the page search bar.

  • Searching for a whole word within a sentence

    I am trying to search for a whole word only in a sentence. The problem is if I use CS then I get things that contain the string in other words. If I use CO or CP then there is no match because there are other words in the sentence. I don't think it's practical to split the sentence into individual words and then compare each word as the sentence is of an unknown length and could be made up of many words.
    An example:
    Sentence 1 - THIS IS ABOUT RF OUTPUTS.
    Sentence 2 - THIS IS ABOUT MY PERFORMANCE
    The user wants to search for sentences containing RF. In this search I only want sentence 1 to be found and not the RF in the word performance in sentence 2.
    Can anyone tell me how to do this.
    Many thanks
    Karen

    DATA: str1(50),
          str2(50),
          srchstr(10).
    DATA: BEGIN OF st_str,
            str(50),
          END OF st_str.
    DATA: it_tab LIKE TABLE OF st_str WITH HEADER LINE.
    str1 = 'THIS IS ABOUT RF OUTPUTS RF'.
    str2 = 'THIS IS ABOUT MY PERFORMANCE RF'.
    srchstr = 'RF'.
    SPLIT str1 AT space INTO TABLE it_tab.
    LOOP AT it_tab WHERE str = srchstr.
      WRITE : srchstr.
      WRITE 'found in'.
      WRITE 'str1'.
      EXIT.
    ENDLOOP.
    CLEAR it_tab[].
    SPLIT str2 AT space INTO TABLE it_tab.
    LOOP AT it_tab WHERE str = srchstr.
      WRITE : srchstr.
      WRITE 'found in'.
      WRITE 'str2'.
      EXIT.
    ENDLOOP.
    Check this code as it solves the leading RF and trailing RF problem .

  • Quick search no longer searches on parts of words, only whole words. How do I fix this?

    Quick search no longer searches on parts of words, only whole words. So for Example, if I were normally searching for my colleague with the last name of chadwick, I would type c then h then a then d until the list on left chadwick. Now, when I do a search on "chadw" nothing comes up and i have to type in the full word or name. I am a victim of one of these recent "upgrades" I guess.

    Never mind. It was because I had the search set to searching the body of all the messages.

  • I want to modify the "find" box to be avble to only search for whole words.

    I want to modify the "find" box to look only for matching "whole words," otherwise--it's pretty pointless!!!

    Also, it is early in the day for this forum as far as activity by the contributor's who really know CSS coding. I bet someone else will have the codes you need later today.

  • Why does double-click no longer select a whole word?

    I am on the beta update channel and currently using FF 8.0, latest update as of the moment of this posting.
    I am not sure when it happened - I think since I started using 8.0 - but double-click no longer selects a whole word. It's the same effect as a single click - simply positions the insertion point where the mouse cursor is located.
    This is very aggravating. I thought it may be a bug in the new version (I already posted it to Bugzilla, but hasn't been confirmed yet), Unfortunately, I don't have the old version to cross-check (can I install both versions on one machine?)
    Or is it some configuration issue? Or conflict with something else? I've searched and not (yet) found any other complaints about this issue from other users.
    Note that I do not have the problem in any other app nor in other browsers that I have installed (e.g., IE, Chrome, Opera, Safari). In all of those, double-click on a word selects the whole word.
    Thanks in advance for any suggestions or guidance.
    Best,
    Yosh

    OK - I found the culprit. It seems that the Answers.com '''1-Click Answers''' utility had changed its behavior. In its Options on the Activation tab is an option to activate it when using double-click in a browser. I don't remember turning it on, but it ''was'' on. When I turned that option off, the problem went away. Apparently it is not compatible with FF8, since double-click was apparently intercepted, but 1-Click Answers was not activated - the double-click simply became a no-op.
    Now that I've turned off that option, double-click in FF8 is back to the way it's supposed to work for quickly selecting a whole word or sentence.
    If anyone else encounters this problem, I hope this information will help to resolve it.

  • 10G-form: How to do MULTIPLE WORD OR SINGLE WORD SEARCH at ITEM?

    I am using 10G DB + 10G Form Builder.
    I've 'database_item' where I am storing multiline text data.
    I want to do MULTIPLE WORD OR SINGLE WORD SEARCH at this item through FORM.
    I've tried by creating the following NON Database Items on the form:
    - multiline_search_text_item, and
    - multiline_result__text_item
    And then writing execute_query in KEY-NEXT-ITEM trigger.
    I've also tried using this in the POST-TEXT-ITEM at multiline_search_text_item:
    select table.database_item into :multiline_result__text_item from table where multiline_search_text_item = :multiline_search_text_item;
    Pl help me asap.
    Gaurav

    What you want to do is not clear.
    The query you wrote will select records where the table contains exactly what has been written in the search item. You can use LIKE and a wildcard search to find records which contain the search text:
    select table.database_item into :multiline_result__text_item
    from table
    where multiline_search_text_item LIKE '%'||:multiline_search_text_item||'%';
    You can use UPPER to make this case insensitive:
    select table.database_item into :multiline_result__text_item
    from table
    where Upper(multiline_search_text_item) LIKE Upper('%'||:multiline_search_text_item||'%');
    But I suspect you want either to match the individual words in the search text to individual words in the database multiline field, or find records where the search words appear (not necessarily as whole words). In that case, check out the following:
    -- set up a table (multiline and various whitespaces)
    DROP TABLE t;
    CREATE TABLE t AS
    SELECT
      ROWNUM rn,
      owner||Chr(9)||object_name||Chr(160)||subobject_name||'    '||object_id||' '||
      data_object_id||Chr(10)||object_type||' '||created||' '||last_ddl_time||' '||
      timestamp||' '||status||' '||temporary||' '||generated||' '||secondary AS col
    FROM all_objects;
    -- check the format of the multiline text item (col)
    SELECT * FROM t WHERE ROWNUM < 4;
    -- a type for the function below
    CREATE TYPE string_tab AS TABLE OF VARCHAR2(255);
    -- this function takes a string and cuts out each word, idetifying words
    -- as being separated by any whitespace.  it returns a collection
    CREATE OR REPLACE FUNCTION string_to_tab(
      p_string IN VARCHAR2) RETURN string_tab IS
      l_string LONG DEFAULT
        RTrim(regexp_replace(p_string,'[[:space:]]+',' ')) || ' ';
      l_data string_tab := string_tab();
      n NUMBER;
    BEGIN
      LOOP
        EXIT WHEN l_string IS NULL;
        n := InStr(l_string, ' ');
        l_data.extend;
        l_data(l_data.Count) := LTrim(RTrim(SubStr(l_string, 1, n - 1)));
        l_string := SubStr(l_string, n + 1);
      END LOOP;
      RETURN l_data;
    END string_to_tab;
    -- selecting from t where ANY of the words in the search text has
    -- a match in the multiline field (as a word or part of a word), so SYS
    -- matches to MDSYS and SYSTEM
    SELECT DISTINCT
      t.rn, t.col
    FROM
      t,
      (SELECT column_value
       FROM TABLE(CAST(string_to_tab('SYS   INDEX') AS string_tab))) x
    WHERE InStr(t.col,x.column_value) > 0;
    -- selecting from t where ALL of the words in the search text has
    -- a match in the multiline field (as a word or part of a word), so SYS
    -- matches to MDSYS and SYSTEM
    SELECT rn, col FROM(
    SELECT
      t.rn, t.col, cnt_x, Count(*) cnt
    FROM
      t,
      (SELECT column_value , Count(1) over(PARTITION BY 1)cnt_x
       FROM TABLE(CAST(string_to_tab('SYS   INDEX') AS string_tab))) x
    WHERE InStr(t.col,x.column_value) > 0
    GROUP BY t.rn, t.col, cnt_x
    WHERE cnt = cnt_x;
    -- selecting from t where ANY of the words in the search text
    -- match a word in the multiline field, so SYS matches only to SYS
    SELECT DISTINCT
      t.rn, t.col
    FROM
      t,
      (TABLE(CAST(string_to_tab(t.col) AS string_tab))) t2,
      (SELECT column_value
       FROM TABLE(CAST(string_to_tab('SYS   INDEX') AS string_tab))) x
    WHERE t2.column_value = x.column_value;
    -- selecting from t where ALL of the words in the search text
    -- match a word in the multiline field, so SYS matches only to SYS
    SELECT rn, col FROM(
    SELECT
      t.rn, t.col, cnt_x, Count(*) cnt
    FROM
      t,
      (TABLE(CAST(string_to_tab(t.col) AS string_tab))) t2,
      (SELECT column_value , Count(1) over(PARTITION BY 1)cnt_x
       FROM TABLE(CAST(string_to_tab('SYS   INDEX') AS string_tab))) x
    WHERE t2.column_value = x.column_value
    GROUP BY t.rn, t.col, cnt_x
    WHERE cnt = cnt_x;For your application you would replace 'SYS INDEX' with a variable (the search field). You can use upper() and wildcards for case insensitive & 'fuzzy' searches. You might need to modify the function so it removes other delimiters such as commas and colons.

  • Find/Change whole words in CS3

    Maybe I'm just being dense, but when I do a find/change in ID CS3 I can't find the option to search for whole words only. The default is set to ignore whole words, so I end up finding a lot of undesirable matches. My last search was for "air," so you can imagine how many false matches I got.
    This was quite obvious in CS2, but those options (including match case) seem to have moved somewhere where I can't find them.
    Any assistance would be most appreciated.
    Mark

    With your mouse, examine each of the icons under the Change field. A tooltip identifies each one. One of them is the one you want.
    Dave

  • Whole word string replacement in LV7.1

    Is there anyway to do whole word string replacement in 7.1?
    For example, if I have the string "x21+sin(x2)" and I want to replace "x2" with "b2" without accidently changing "x21" into "b21". I saw that 7.1 does not support the word boundary "\b" in regex.

    The easy solution is to search for "(x2)" and replace with "(b2)" but if you're not sure that x2 will always be in parenthesis, then another solution would be to get the next character after "x2" is found, and if it is not a number (0-9) then you have found x2, if it is a number then you have found x21, or x22, etc.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Replace Function: Replacing Whole Words Only

    I'm enhancing the verity search on a project I'm working on,
    removing the operator words (as well as others) from search
    criteria before passing it to the verity engine. The only problem
    I'm having so far is stripping out the whole words "AND", "OR", and
    "NOT" from user-specified search criteria. I obviously want to do
    it only in cases where "AND", "OR", and/or "NOT" are the whole
    word, and not replace things like "hand", "organization", and
    "notingham". It's probably so simple, but I'm a bit stumped.
    While I'm here, has anyone developed anything to enhance
    verity results, or know of a resource I could look into
    further?

    you can do this with ReReplace()
    look in the documentation for "boundary", somewhere in the
    regex
    documentation, and you'll find what you're looking for. i
    think it's "\b",
    so it's something along the lines of
    ReReplace(str,"\b(and|or|not)\b","","all")
    "ckbentdesigns" <[email protected]> wrote in
    message
    news:etsdqh$igj$[email protected]..
    > I'm enhancing the verity search on a project I'm working
    on, removing the
    > operator words (as well as others) from search criteria
    before passing it
    > to
    > the verity engine. The only problem I'm having so far is
    stripping out the
    > whole words "AND", "OR", and "NOT" from user-specified
    search criteria. I
    > obviously want to do it only in cases where "AND", "OR",
    and/or "NOT" are
    > the
    > whole word, and not replace things like "hand",
    "organization", and
    > "notingham". It's probably so simple, but I'm a bit
    stumped.
    >
    > While I'm here, has anyone developed anything to enhance
    verity results,
    > or
    > know of a resource I could look into further?
    >

  • KeywordQuery is matching the whole word

               
    hi
    i am using Microsoft.SharePoint.Client.Search. The search works fine except the thing that is matching the whole word.
    For example if i search for the word gips i get hits back,  but if i search only gip i don't get any results back. Is there a way to avoid this behavior?
    KeywordQuery kq = new KeywordQuery(kq.QueryText = text + " AND path:\"" + path + "\"";
    kq.TrimDuplicates = false;
    SearchExecutor searchExecutor = new SearchExecutor(context);
    ClientResult<ResultTableCollection> results = searchExecutor.ExecuteQuery(kq);
    context.ExecuteQuery();

    Try appending the wildcard character "*" (without the quotes) to the query.
    Start here:  http://benprins.wordpress.com/2013/03/13/sharepoint-2013-search-tips-and-tricks/
    I trust that answers your question...
    Thanks
    C
    |
    RSS |
    http://crayveon.com/blog |
    SharePoint Scripts | Twitter |
    Google+ | LinkedIn |
    Facebook | Quix Utilities for SharePoint

Maybe you are looking for

  • Spyder4Pro in Photoshop CS5 - which proof setup?

    Hello I just ran Spyder4Pro calibration on my monitor for the first time. I am using a PC. Monitor Specs: Dell SP2309W 2048*1152 Pixel Resolution 23 LCD Display VGA,DVI,HDMI connectivities on NVIDIA GeForce GTX 460 Photoshop CS5 Extended I have my mo

  • Bex broadcaster in bex analyzer

    Dear all, I have created a report in bex analyzer. I want to add this report to portal, therefore  i need to select bex broadcasting from excel bex analyzer menu. My questions are as follows: 1) As i read in document, i can put analyzer reports in po

  • Want to updated sales pricing procedure through quotation

    Hello Friends, In general scenario: we update any condition type in vk11 tcode and tht is reflected in quotation pricing. my requirement : while creating quotation if the user changes any price for any condition tht should automatically get updated i

  • What happened to the tags in my podcasts?

    I have used Podrunner's 5K interval training podcast series for years. Now, in the new podcast app, I can't see the tagging that shows me the duriation of the run and rest periods. How do you see the tags? When I click on the podcast image, I only ge

  • Can i RollBack in BusinessOne

    Hi all,     I have one doubt while using DI API. I am creating Sales Invoice using DI API. For some reasons i need to rollback the created SalesInvoice. Is it possible using DI API. If it is  a salesorder i have a option of cancelling the salesOrder.