<?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: ABAP regular expression in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136423#M1975639</link>
    <description>&lt;P&gt;Many other variants are also possible, for instance this one:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIND REGEX '~(\w{4})~[^~]*~(\w{4})' SUBMATCHES DATA(plant1) DATA(plant2).&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 07 May 2020 16:49:19 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2020-05-07T16:49:19Z</dc:date>
    <item>
      <title>ABAP regular expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136420#M1975636</link>
      <description>&lt;P&gt;Hi Expert,&lt;/P&gt;
  &lt;P&gt;How can we make use of Regex to find specific pattern e.g. Plant value from string. This plant will be either numeric or alphanumeric and 4 digit code.&lt;/P&gt;
  &lt;P&gt;PFB the example:&lt;/P&gt;
  &lt;P&gt;TEST Plant~A030~NEW TEST Plant~0320&lt;/P&gt;
  &lt;P&gt;From above string, I want to extract 2 values i.e. A030 &amp;amp; 0320.&lt;/P&gt;
  &lt;P&gt;How can form the regex for this scenario?&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Sanjana&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 16:10:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136420#M1975636</guid>
      <dc:creator>sanjana_lingras</dc:creator>
      <dc:date>2020-05-07T16:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP regular expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136421#M1975637</link>
      <description>&lt;P&gt;Based on your description, it is not totally clear how you want to look for it.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Do you just want to look for the two specific known codes, e.g. A030 and 0320?&lt;BR /&gt;With the regex 'A030|0320' you look for A030 and 0320 &lt;/LI&gt;&lt;LI&gt;Do you want to look for any kind of values that could possible be the technical code of a plant from table T001W? In that case you would have to read all plants from T001W, concatenate them into a string separated by | and use that as your regex.&lt;/LI&gt;&lt;LI&gt;Or do you just want to look for the next four digits after the substring "Plant~" and make sure that these four digits are either numbers and/or capital letters?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Use the Report DEMO_REGEX_TOY to test your regex.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 16:36:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136421#M1975637</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-05-07T16:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP regular expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136422#M1975638</link>
      <description>&lt;P&gt;Hi Sanjana&lt;/P&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; 
DATA: result_tab TYPE match_result_tab.
FIND ALL OCCURRENCES OF regex 'Plant~*' IN 'TEST Plant~A030~NEW TEST Plant~0320'
                     RESULTS result_tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The result tab will give you the Offset Position. &lt;/P&gt;&lt;P&gt;From there you can pick the Plant name&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 16:37:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136422#M1975638</guid>
      <dc:creator>venkateswaran_k</dc:creator>
      <dc:date>2020-05-07T16:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP regular expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136423#M1975639</link>
      <description>&lt;P&gt;Many other variants are also possible, for instance this one:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIND REGEX '~(\w{4})~[^~]*~(\w{4})' SUBMATCHES DATA(plant1) DATA(plant2).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 May 2020 16:49:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136423#M1975639</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-05-07T16:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP regular expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136424#M1975640</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;PFB the answers&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;Do you just want to look for the two specific known codes, e.g. A030 and 0320?&lt;BR /&gt;With the regex 'A030|0320' you look for A030 and 0320&lt;/LI&gt;&lt;LI&gt;--&amp;gt; No specific plant , plant could be any 4 digit plant concatenated in string , either numeric or alphanumeric&lt;/LI&gt;&lt;LI&gt;Do you want to look for any kind of values that could possible be the technical code of a plant from table T001W? In that case you would have to read all plants from T001W, concatenate them into a string separated by | and use that as your regex.&lt;/LI&gt;&lt;LI&gt;--&amp;gt; No need of T001W plant validation.&lt;/LI&gt;&lt;LI&gt;Or do you just want to look for the next four digits after the substring "Plant~" and make sure that these four digits are either numbers and/or capital letters?&lt;/LI&gt;&lt;LI&gt;--&amp;gt; This format is not fixed Plant~*, it may come at any place. We just need to extract those 4 digit (numeric or alphanumeric) substring from main string.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sanjana&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 17:09:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136424#M1975640</guid>
      <dc:creator>sanjana_lingras</dc:creator>
      <dc:date>2020-05-07T17:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP regular expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136425#M1975641</link>
      <description>&lt;P&gt;If the plant is not superceded by a specific substring (like for instance 'Plant~') and it is not validated (like against T001W), how will you know, that the found four digits are actually a plant? Based on you example "TEST Plant~A030~NEW TEST Plant~0320", if you test for consecutive four alphanumerical values and possible letters in capital only, you would get this result instead:&lt;/P&gt;&lt;UL&gt;
&lt;LI&gt;TEST&lt;/LI&gt;&lt;LI&gt;A030&lt;/LI&gt;&lt;LI&gt;TEST&lt;/LI&gt;&lt;LI&gt;0320&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So clearly, TEST shouldnt be a plant, but without validation and without superceding substring, it will be identfied as such by the regex.&lt;/P&gt;&lt;P&gt;(If you dont test against capital letters, you would also get 'Plan' and 'lant' twice.)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please review your requirements and give a feedback.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 17:19:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136425#M1975641</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-05-07T17:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP regular expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136426#M1975642</link>
      <description>&lt;P&gt;Yes , Micheal I agree validation for plant is needed but fetching all plants from T001W and comparing each plant with input string to check if it valid or not is bit performance intensive.&lt;/P&gt;&lt;P&gt;so better way would be to extract 4 digit numeric and alphanumeric code and then validate it against T001W in one go later on.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sanjana&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 17:24:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136426#M1975642</guid>
      <dc:creator>sanjana_lingras</dc:creator>
      <dc:date>2020-05-07T17:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP regular expression</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136427#M1975643</link>
      <description>&lt;P&gt;You should define a clear rule, otherwise people will come again and again saying that in some situations there is a bug, and you won't be able to protest because you can't tell the rule. Worse than that, any "correction" will then provoke regressions for some other people.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 17:51:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-regular-expression/m-p/12136427#M1975643</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-05-07T17:51:17Z</dc:date>
    </item>
  </channel>
</rss>

