<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Word Search Using Prxmatch in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344199#M272991</link>
    <description>&lt;P&gt;It's hard to say without knowing exactly what you're searching for or what you're data might have, but for the example you provided something like prxmatch('/\btre\b/i', my_text) should fix the issue. The \b signifies a word boundary. If you just had a space, you would not find any "tree" values where "tree" starts the string.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2017 20:05:44 GMT</pubDate>
    <dc:creator>collinelliot</dc:creator>
    <dc:date>2017-03-24T20:05:44Z</dc:date>
    <item>
      <title>Word Search Using Prxmatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344196#M272990</link>
      <description>&lt;P&gt;I am using the prxmatch function to search for words in a variable. &amp;nbsp;However, I got results that are not perfect match. &amp;nbsp;In particular, I was trying to search for the word "tree", but I also got "street". &amp;nbsp;How do I get a perfect match, i.e., to exclude results that have words that include words that I am actually searching for?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344196#M272990</guid>
      <dc:creator>docctong</dc:creator>
      <dc:date>2017-03-24T20:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Word Search Using Prxmatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344199#M272991</link>
      <description>&lt;P&gt;It's hard to say without knowing exactly what you're searching for or what you're data might have, but for the example you provided something like prxmatch('/\btre\b/i', my_text) should fix the issue. The \b signifies a word boundary. If you just had a space, you would not find any "tree" values where "tree" starts the string.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 20:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344199#M272991</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-24T20:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Word Search Using Prxmatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344210#M272992</link>
      <description>&lt;P&gt;Thanks for the reply. &amp;nbsp;Below is the code that I had written and trying to find the cases that broken tree is involved:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data spct.tree;&lt;BR /&gt;set treedata;&lt;BR /&gt;if prxmatch("m/trees|limbs|branches/oi", combined_description) &amp;gt; 0 then tree=1;&lt;BR /&gt;else tree=0;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, like I said, the results include cases that show something like "a man walking on the street" because "tree" is part of the word street. &amp;nbsp;Since I have multiple words, as you can see, that I put in to search that I think is related to tree, how or where do I add the "\b" option so to take care of the problem? &amp;nbsp;Thanks and truly appreciate your help. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 21:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344210#M272992</guid>
      <dc:creator>docctong</dc:creator>
      <dc:date>2017-03-24T21:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Word Search Using Prxmatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344212#M272993</link>
      <description>&lt;P&gt;Again, this might not do everything you want depending on your data, but this is how you'd incorporate the word boundary into your code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if prxmatch("m/\btrees\b|\blimbs\b|\bbranches\b/oi", combined_description) &amp;gt; 0 then tree=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that you can also get the 0, 1 boolean you want by using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tree = prxmatch(....) &amp;gt; 0;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 21:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344212#M272993</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-24T21:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Word Search Using Prxmatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344250#M272994</link>
      <description>&lt;P&gt;To match singular and plural words, you could use&amp;nbsp;"m/\b(trees?|limbs?|branch(es)?)\b/oi"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;\b means word boundary&lt;/P&gt;
&lt;P&gt;? means match zero or one occurence&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2017 03:16:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/344250#M272994</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-03-25T03:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Word Search Using Prxmatch</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/345758#M272995</link>
      <description />
      <pubDate>Thu, 30 Mar 2017 14:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Word-Search-Using-Prxmatch/m-p/345758#M272995</guid>
      <dc:creator>docctong</dc:creator>
      <dc:date>2017-03-30T14:27:36Z</dc:date>
    </item>
  </channel>
</rss>

