<?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: Regular expression for search string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882205#M1790147</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you say irrespective of order, with a condition that all words have to appear in string, you are looking for an irregular expression instead of a regular one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For 4 words, there are 24 permutations possible (4P4).&lt;/P&gt;&lt;P&gt;You could put loop and use regex to find every possible permutation, or combine all permutations to single regex which would be ugly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For 10 words, you just have to loop through word list and look for their occurrence, setting false flag on first failed search. Regex isn't really required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please go with Rüdiger's reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Oct 2013 14:41:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-10-28T14:41:52Z</dc:date>
    <item>
      <title>Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882195#M1790137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I am trying to create a regular expression which can search for a combination of words in a string:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example my search string is : "Find the right solutions to extend the value of your SAP software investments"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to search for "solutions" , "software" in this string such that these 2 words exist in the search string in any order , in any sequence, and only the matching words.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot do this with a Find command as my search key words can be dynamic i.e 2 or 3 or more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I searched for regex and found "|\software\b|\bsolutions\b|" but this is an OR condition and I want a and condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone please advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 13:50:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882195#M1790137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T13:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882196#M1790138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with following code.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;DATA lv_str &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string &lt;SPAN class="L0S52"&gt;VALUE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'Find the right solutions to extend the value of your SAP software investments'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;lv_str &lt;SPAN class="L0S52"&gt;CS &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'solutions' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;and &lt;/SPAN&gt;lv_str &lt;SPAN class="L0S52"&gt;CS &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'software'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WRITE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'true'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WRITE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'False'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 13:57:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882196#M1790138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T13:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882197#M1790139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;PARAMETERS&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;lv_str &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; search1 &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; search2 &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;lv_str &lt;SPAN class="L0S52"&gt;CS &lt;/SPAN&gt;search1 &lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;lv_str &lt;SPAN class="L0S52"&gt;CS &lt;/SPAN&gt;search2&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WRITE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'true'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WRITE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'False'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:01:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882197#M1790139</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T14:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882198#M1790140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;DATA&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;p_string &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p_search1 &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; p_search1 &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'solutions'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; p_string &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'Find the right solutions to extend the value of your SAP software investments'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;SEARCH &lt;/SPAN&gt;p_string &lt;SPAN class="L0S52"&gt;FOR &lt;/SPAN&gt;p_search1&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;subrc &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WRITE &lt;/SPAN&gt;p_search1&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:01:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882198#M1790140</guid>
      <dc:creator>venkat_aileni</dc:creator>
      <dc:date>2013-10-28T14:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882199#M1790141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandra,&lt;/P&gt;&lt;P&gt;I cannot use the CS operator because the search keywords can be 2 or 3 or more and determined at runtime dynamically.&lt;/P&gt;&lt;P&gt;User can input any kewords to search and hence I am trying to find out a regex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:04:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882199#M1790141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T14:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882200#M1790142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Bhanu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find the logic below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_string = '&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;Find the right solutions to extend the value of your SAP software investments&lt;/SPAN&gt;'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;FIND &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;FIRST &lt;/SPAN&gt;OCCURRENCE &lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;REGEX &lt;SPAN class="L0S33"&gt;'solutions' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;IN &lt;/SPAN&gt;l_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FIND &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;FIRST &lt;/SPAN&gt;OCCURRENCE &lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;REGEX &lt;SPAN class="L0S33"&gt;'&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;software&lt;/SPAN&gt;' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;IN &lt;/SPAN&gt;l_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Arriving at this stage your variable l_string contains both the word solutions and software&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "you can continue with your processing now in this block of code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "and if you have dynamic text then loop in the internal table and continue the processing while&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "filling the string variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Kind Regards,&lt;/P&gt;&lt;P&gt;Yovish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:05:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882200#M1790142</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T14:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882201#M1790143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:07:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882201#M1790143</guid>
      <dc:creator>asdasd_asdasd</dc:creator>
      <dc:date>2013-10-28T14:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882202#M1790144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The former replies didn't read or ignored the condition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"in any sequence, any order"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you solve this with regexes, the and condition you are looking for is simply writing the search terms one after the other. But since you want it in any order, you have two expressions for the two possible orders: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'\bsoftware\b.*\bsolutions\b|\bsolutions\b.*\bsoftware\b'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, this gets clumsy if you say you want to have even more search strings. In this case I would &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;build a stringtab of all search words ( data: lt_terms type stringtab. ), and&lt;/LI&gt;&lt;LI&gt;loop over this stringtab, performing an ordinary find with each word, &lt;/LI&gt;&lt;LI&gt;If one of the find operations fails, leave the method with answer =&amp;nbsp; abap_false.&lt;/LI&gt;&lt;LI&gt;If you survived the loop, leave the method with answer = true.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rüdiger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:14:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882202#M1790144</guid>
      <dc:creator>Ruediger_Plantiko</dc:creator>
      <dc:date>2013-10-28T14:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882203#M1790145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest that you post this on a forum that has expertise in Regex. I use Regex fairly regularly, but for complex stuff, I have my own expert to ask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's unlikely you'll find the expertise here - as you can tell by the number of people offering CS as a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd also suggest that when you get the answer you post it here!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:14:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882203#M1790145</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2013-10-28T14:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882204#M1790146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Bhanu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this code;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_text&amp;nbsp;&amp;nbsp; TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: l_srch&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF l_word OCCURS 0,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; word(50),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END OF l_word.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_text = 'Find the right solutions to extend the value of your SAP software investments'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- whatever text you give in parameter is broken into words&lt;/P&gt;&lt;P&gt;*-- and each word is stored in a line of table.&lt;/P&gt;&lt;P&gt;SPLIT l_srch AT ' ' INTO TABLE l_word.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- if user has given extra spacing between words&lt;/P&gt;&lt;P&gt;*-- then delete the extra lines which does not have any word to compare.&lt;/P&gt;&lt;P&gt;Delete l_word where word is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- loop for each word and search the word in the string&lt;/P&gt;&lt;P&gt;*-- then do your own processing.&lt;/P&gt;&lt;P&gt;LOOP AT l_word.&lt;/P&gt;&lt;P&gt;&amp;nbsp; SEARCH l_text FOR l_word-word.&lt;/P&gt;&lt;P&gt;&amp;nbsp; if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "This means the word is present in string&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "word is not present in string.&lt;/P&gt;&lt;P&gt;&amp;nbsp; endif.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:15:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882204#M1790146</guid>
      <dc:creator>former_member219162</dc:creator>
      <dc:date>2013-10-28T14:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882205#M1790147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you say irrespective of order, with a condition that all words have to appear in string, you are looking for an irregular expression instead of a regular one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For 4 words, there are 24 permutations possible (4P4).&lt;/P&gt;&lt;P&gt;You could put loop and use regex to find every possible permutation, or combine all permutations to single regex which would be ugly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For 10 words, you just have to loop through word list and look for their occurrence, setting false flag on first failed search. Regex isn't really required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please go with Rüdiger's reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:41:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882205#M1790147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T14:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882206#M1790148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; &lt;SPAN class="L0S52"&gt;DATA lv_str &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string &lt;SPAN class="L0S52"&gt;VALUE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'Find the right solutions to extend the value of your SAP software investments'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN class="L0S52"&gt;DATA&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; ls_search &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; lt_search&amp;nbsp; &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;OF &lt;/SPAN&gt;string&lt;SPAN class="L0S55"&gt;,&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; lv_flag &lt;SPAN class="L0S52"&gt;TYPE &lt;/SPAN&gt;char1&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN class="L0S52"&gt;APPEND &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'solutions' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;lt_search&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;APPEND &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'right' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TO &lt;/SPAN&gt;lt_search&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; "&lt;SPAN class="L0S31"&gt;APPEND 'right1' TO lt_search.&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN class="L0S52"&gt;LOOP &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AT &lt;/SPAN&gt;lt_search &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;ls_search&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CLEAR &lt;/SPAN&gt;lv_flag&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;lv_str &lt;SPAN class="L0S52"&gt;CS &lt;/SPAN&gt;ls_search&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_flag &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'X'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CLEAR &lt;/SPAN&gt;lv_flag&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EXIT&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;ENDLOOP&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;lv_flag &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'X'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WRITE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'Found'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WRITE &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'Not found'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 14:59:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882206#M1790148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T14:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882207#M1790149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rüdiger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 15:21:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882207#M1790149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T15:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882208#M1790150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Guys for your replies, I will try to find word by word instead of a clumsy Regex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 15:22:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882208#M1790150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T15:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882209#M1790151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried code posted in previous comment ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 17:19:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882209#M1790151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-10-28T17:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression for search string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882210#M1790152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just an addendum for the logical AND question in regex: Since ABAP regexes support the non-capturing lookahead assertion, the following regex would do it &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(?=.*solutions)(?=.*software)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compare for example Peter Thoeny's recent presentation on regexes: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://twiki.org/cgi-bin/view/Codev/TWikiPresentation2013x03x07?slideshow=on;skin=print;extralog=-+caching+topic#GoSlide24"&gt;http://twiki.org/cgi-bin/view/Codev/TWikiPresentation2013x03x07?slideshow=on;skin=print;extralog=-+caching+topic#GoSlide24&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 19:03:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regular-expression-for-search-string/m-p/9882210#M1790152</guid>
      <dc:creator>Ruediger_Plantiko</dc:creator>
      <dc:date>2013-11-01T19:03:13Z</dc:date>
    </item>
  </channel>
</rss>

