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 .

Similar Messages

  • 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 I search for a specific word in the code using Dreamweaver?

    I need to search for a specific word in the code for all of my website pages. How can I do that using Dreamweaver?

    To search local files of a Defined Site in DW...
    Open the Find & Replace tool with Ctrl + F
    Change the Find In dropdown to Entire Current Local Site
    Change the Search dropdown to Text or Source code
    Add the text to find in the Find field
    Add the text to replace in the Replace field (or nothing if you just want to delete the text)
    Hit Replace All

  • How to search for a particular word in notes app (ios6)

    Sir,
    I can search for a note but i couldnt search for a particular word in a long note in notes app.
    (ios 6)
    is there a way to do it,or is there any app that has this 'search for word' functionality ?

    thank you for your quick reply sir.
    i am asking for other independent notable apps(not notes app) which has this functionality .

  • How to search for a particular word in a string?

    How to search for a particular word in a string?
    thanks for your help....

    This works fine.
    public class Foo {
        public static void main(String[] args) {
        String s = "Now is the time for all good...";
        String s2 = "the time";
        System.out.println(s.contains(s2));
        System.out.println(s.contains("for al"));
        System.out.println(s.contains("not here"));
    }output:true
    true
    falseYou must have something else wrong in your code.
    JJ

  • How to search for a particular word in a long document?

    How to search for a particular word in a long document?

    What program are you using to read the document?
    Good luck.

  • Search for a reserved word?

    Can I make Oracle Text do a search for a reserved word?
    I've got users searching for 'not well' and 'forget me not', and although I've trapped that and wrapped the word in braces (so the searches are passed as ...contains(searchfield,'({not}) and well')>0, for example), the results show a lot of very healthy people and holes in the ground with water in them: only the 'well' bit is being recognised, it seems.
    Similarly, 'forget me not' is being searched as 'forget and me', with the 'not' bit seemingly being ignored.
    Can I get a 'not', when the first or last word in a search, to be searched for as that word?

    NOT is a stoplist word.
    Either get rid of the stoplist entirely, or create a custom stoplist that allows NOT as a token, and you should be good to go.

  • Can I search for pdf and word documents at the same time in finder?

    I often want to search for more than one file type at a time - for instance pdfs and word docs in a directory, or Jpgs, GIFs, PNGs etc.
    Can I do this in the finder in one go (so I can save it as a folder I can then select when I want to)?
    I tried typing OR between the 'tokens' it creates, but then it just searches for OR - so not as intelligent as one would think?!
    Surely there must be a way to do something as simple as this?
    regards
    Rob

    Forget the whole "tokens" business (I think that is a pretty useless "improvement" to constructing Spotlight searches). Hit command-F to bring up the search window, and set your first criteria, in the example I changed it from the default Kind to Created Date, to keep the number of results manageable. Now hold down the Option key and click on the "+" at the end of the criteria line, it will change to "..." and you get a new criteria line. From the dropdown menu choose "Any" if necessary (this will give you the Boolean OR), then enter what you want in the first sub-head. To get a second sub-head OR criteria click the "+" at the end of the Any line.
    I don't generate many MS Word docs, so I just stopped in the example above after typing Microsoft, since that brought up all the MS anything I have from this year (a couple of Power Point thingies sent to me by friends).
    Francine

  • Can you use Find/Change to search for many different words at once?

    I have an 80 page catalogue in Indesign (CS5) - it has several thousands of catalogue numbers listed as text within it. I've just been given a list of 1000 catalogue numbers to search for and if they appear, remove them - is there any way to search for them all in one go, rather than one by one?
    I've started using Find/Change to search for the catalogue numbers but seem to only be able to search one catalogue number at a time that way.
    Any ideas welcome!
    Thanks

    GREP can search for more than one phrase "at once" (i.e., in one operation), like this:
    word1|word2|word3
    -- the pipe | delimits the separate words. Then again, GREP Is Not Magic™. This --
    ...  a list of 1000 catalogue numbers to search for ...
    is a bit too much to copy-and-paste into the single Find What line. There is a limit of ten or twelve (or something) OR phrases you can use in GREP.
    On the other hand: GREP is great at finding numbers. If all of your catalogue numbers obey some basic rule, for instance "all of them consist of 6 digits and there are no other numbers with exactly 6 digits", well, that we can probably work with.

  • How do I search for songs and artists within playlists?

    In the Itunes music app on the Ipod touch there are several views (Songs, Playlists, Genius, Artists, etc.) In song view if you swipe down it reveals the search bar. However when you go to Playlist view and choose a specific playlist there is no search bar or option anywhere to search for a specific song, artist, genre etc.
    So how the heck do we search within playlists, where is the search bar or where is the option to search in a specific playlist?

    Top right hand corner of the store is the search bar. Just type it in, and it shows up.

  • Search for a footage item within a folder item?

    how do you search for a footage item that may be in a folder item ?
    eg: i have a comp as the first item in my project panel, then i have a folder containing the three footage items that belong to that comp below.
    in my script i want to create a variable to store a particular footage item called "background". though i dont know how to search for it if its contained within a folder (called "footage").
    can anyone pleease help a newbie
    thanks,
    Sam

    Like this:
    var myFootage = null;
    for (var i = 1; i <= app.project.numItems; i++){
      if ((app.project.item(i) instanceof FootageItem) && (app.project.item(i).name == "background")){
        if (app.project.item(i).parentFolder.name == "footage"){
          myFootage = app.project.item(i);
          break;
    // at this point myFootage is either your background footage, or null if not found
    Dan

  • How do I search for all "missing" tracks within the iTunes database?

    I found the dreaded ! of death, and sadly I verified the tacks indeed are not on my hard drive.
    Is there a way to sort on this tag so that I can see what else might be missing on my hard drive but remains in the database (sort of similar to how you can search for all tracks that have missing artwork)? 

    Thanks.  It works perfectly.
    URL for anyone else in need:  http://dougscripts.com/123

  • Is there a way to search for a specific keyword within the sites to which the bookmarks are linked? I need to search all linked sites in the bookmark folder without having to open each page and "find" manually.

    Currently, I must browse through 50 or so bookmarked pages to see if a specific topic is covered. I would like to be able to search all bookmarked pages at once for a specific keyword. For example, if I have 50 news sites bookmarked and I would like to see which pages have the word "tuna" in them, I would need to open each page individually and do a "find". If I could search all of those pages at once, then I would save an immense amount of time. I have looked on the add-ons and found nothing...

    1. Create a smart album and in the drop down in the top right corner select file status
    2. Check mark the file status box and select 'Offline'
    Now you should have all your 'Offline' (Yellow Exclamation and/or Red Slash) files.
    To reconnect..
    1. Select the missing files.
    2. Go to File and scroll to Manage Referenced Files
    The dialog box will have one of the photos selected
    3. Select the drive and folder that contains the referenced file and select it
    4. Click 'Reconnect All'
    This might not reconnect all of them, but the dialog box will still be open and you can reconnect the ones left.
    Narvon
    Message was edited by: Narvon

  • How can I search for partial matching words in various columns without needing to provide search text?

    I have a list of names in three columns - B2:B425, D2:406, & E2:30 where they were input by different people, so the names are worded differently. For example, I can have the name "Handler, Jones, & Wright" and someone else has the name
    listed as "Handler Corp." What I need is to find a formula or VBA macro code that can search through my list and notice the possible duplicates and highlight them. Since they are all different names, I cannot give it a unique "text" to
    search.
    I found a code posted in this forum from some time ago (for two columns) but it highlighted all these names that had no partial words in common. Perhaps you can look over the code below and modify it for me or provide me with another one? Please let me know
    if you need any further information to guide me. 
    Sub HighlightDups()
        Dim rg1 As Range, rg2 As Range, c As Range, d As Range
        Dim sTemp As String, sTempWords() As String, sTempDWords() As String
        Dim re As Object, mc As Object
        Dim i As Long, j As Long
        Dim sFirstAddress As String
    Set rg1 = Range("B2", Cells(Rows.Columns.Count, "B").End(xlUp))
    Set rg2 = Range("D2", Cells(Rows.Columns.Count, "D").End(xlUp))
    Set re = CreateObject("vbscript.regexp")
        re.Global = True
        re.ignorecase = True
    With Range(rg1, rg2)
        .Font.Color = vbBlack
        .Font.Bold = False
        .Interior.Color = xlNone
        .FormatConditions.Delete
    End With
    For Each c In rg1
      re.Pattern = "\b\w+\b"
      If re.test(c.Text) = True Then
        Set mc = re.Execute(c.Text)
            ReDim sTempWords(0 To mc.Count - 1)
            For i = 0 To UBound(sTempWords)
                sTempWords(i) = mc(i)
            Next i
        For i = 0 To UBound(sTempWords)
            Set d = rg2.Find(What:=sTempWords(i), _
                             LookIn:=xlValues, _
                             LookAt:=xlPart, _
                             MatchCase:=False)
            If Not d Is Nothing Then
                re.Pattern = "\b" & sTempWords(i) & "\b"
                sFirstAddress = d.Address
                Do
                        If re.test(d.Text) Then
                    With c
                        .Font.Color = vbWhite
                        .Font.Bold = True
                        .Interior.Color = vbBlue
                    End With
                    With d
                        .Font.Color = vbWhite
                        .Font.Bold = True
                        .Interior.Color = vbBlue
                    End With
                        End If
                    Set d = rg2.FindNext(after:=d)
                    Loop While Not d Is Nothing And d.Address <> sFirstAddress
            End If
        Next i
      End If
    Next c
    Set re = Nothing
    End Sub
     

    Programming/Code related questions should really be posed in one of the following forums
    Excel for Developers
    http://social.msdn.microsoft.com/Forums/en-US/exceldev
    Microsoft Office Programming
    http://answers.microsoft.com/en-us/office/forum/customize?page=1&tab=all&tm=1361680524815
    Tony Chen
    TechNet Community Support

  • Error message when searching for an object link within EasyDMS

    Hello,
    I have a problem with the easydms system. Everything works fine except searching in the object links. When I want to define an object link and I don't know the name of the object I try to find it with the help of the search function within easydms (within the object links).
    But the search always delivers an error message:
    "Missing authorization check to display master data"
    Does anybody now what to do?
    Thank you for your help.
    Best regards,
    Markus Sigl

    Hi Markus,
    When you try to do this the  BAPI 'BAPI_HELPVALUES_GET' is used. There are some authorization checks that are being performed for the object. These authorizations are maintained in the table BAPIF4T.
    For the above said test data, you are trying to get the help values for
    the relevant field (e.g. EBELN: po_number).However,in table BAPIF4T the corresponding authorization for the data element ebeln is not maintained. And so you are getting this error.
    So, when you maintain the below record in the table BAPIF4T,you will
    have the corresponding authorization and you will not get the error
    anymore.
    sample entry:
    Object type - ' '
    Object type component - ' '
    BAPIF4T-DTEL - 'EBELN'
    BAPIF4T-FNAM - 'PLM_HELPVALUES_AUTHCHECK'
    Best regards,
    Christoph

Maybe you are looking for

  • How do I generate a duplicate copy of my photos on another hard drive without loosing the keywords?

    I want to back up my photos on another hard drive and access them from my main catalog? How do I do that? If I use Lightroom to move the folder onto another hard drive it does not give me the option to copy them. I have to actually move them, which d

  • How  to update my mc book 10.5

    hii how to update 10.5  and i dont have cd   can u pls help me out,,..?

  • Tecra A11 - Serial port not working

    I have a Tecra A11 running windows 7 professional (32 bit). My serial port does not appear to be operating as I am no longer able to connect to industrial automation PLC's which require connection to the serial port for programming. Some of the softw

  • Bluetooth email disappeared Z10 10.2.1.537 Update

    Updated Z10 to 10.2.1.537.  Can no longer get email in my car (bmw).  When I go to BLUETOOTH / CONFIGURE therre used to be, under MESSAGE ACCESS ACCOUNTS an option for email to check - now, after software 'upgrade' there is no longer an 'email' optio

  • Concept on KM

    Hi Trying to clarify on KMs. When I import a KM from impexp folder ODI stores the information from the XML into work repositories tables?.. I tried the following it worked. 1) Imported IKM Oracle Incremental Update into my Project and created an inte