<?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: Write REGEX for a string pattern in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395734#M1842115</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll test and come back ..:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jul 2014 12:42:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-07-02T12:42:17Z</dc:date>
    <item>
      <title>Write REGEX for a string pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395729#M1842110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to using regular expression and writing the patterns, I am looking to write a pattern for below formats and do a FIND REGEX:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A123456-01-123456789-123&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; and &lt;STRONG&gt;A123456-01-123456789-ABC&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;DATA: regex TYPE REF TO cl_abap_regex,&lt;/STRONG&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; background-color: #ffffef;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; res&amp;nbsp;&amp;nbsp; TYPE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; match_result_tab,&lt;/STRONG&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; background-color: #ffffef;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text&amp;nbsp; TYPE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string.&lt;/STRONG&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; background-color: #ffffef;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;CREATE OBJECT regex&lt;/STRONG&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; background-color: #ffffef;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXPORTING pattern&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/STRONG&gt;&lt;STRONG style="text-decoration: underline;"&gt;&lt;SPAN style="color: #00ccff; text-decoration: underline;"&gt;'\(.\)\1' &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&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; simple_regex = 'X'&lt;/STRONG&gt;&lt;SPAN style="color: #000000; font-family: 'Times New Roman'; background-color: #ffffef;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;FIND ALL OCCURRENCES OF REGEX regex IN text RESULTS res.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;could you help me write the pattern to check if user has entered string in formats &lt;STRONG&gt;A123456-01-123456789-123&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; and &lt;STRONG&gt;A123456-01-123456789-ABC &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;Thank you&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: 10pt; background-color: #ffffef; font-family: 'Courier New';"&gt;Depp&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 10:22:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395729#M1842110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-18T10:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Write REGEX for a string pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395730#M1842111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try out this snippet.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DATA str TYPE string VALUE 'A123456-01-123456789-123'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FIND REGEX '^\w\d{6}-\d{2}-\d{9}-.{3}$' IN str.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WRITE / sy-subrc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;str = 'A123456-01-123456789-ABC'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FIND REGEX '^\w\d{6}-\d{2}-\d{9}-.{3}$' IN str.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WRITE / sy-subrc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 10:34:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395730#M1842111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-18T10:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Write REGEX for a string pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395731#M1842112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It appears you wanted separate regex patterns that match the given strings.&lt;/P&gt;&lt;P&gt;If that is the case, &lt;SPAN style="font-family: courier new,courier;"&gt;'^\w\d{6}-\d{2}-\d{9}-\d{3}$'&lt;/SPAN&gt; would be for the one ending with 123, and &lt;SPAN style="font-family: courier new,courier;"&gt;'^\w\d{6}-\d{2}-\d{9}-\w{3}$'&lt;/SPAN&gt; would be for the one ending with ABC.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 17:01:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395731#M1842112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-18T17:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: Write REGEX for a string pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395732#M1842113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all sorry for getting back so late..was stuck with project delivery...and Thank you for your solution. Only one scenario failed i.e., I didn't mention that the value 01 in the examples, is constant in strings &lt;STRONG style="font-size: 12px; color: #333333; background: #ffffff;"&gt;A123456-&lt;SPAN style="text-decoration: underline;"&gt;01&lt;/SPAN&gt;-123456789-123&lt;/STRONG&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp; and &lt;/SPAN&gt;&lt;STRONG style="font-size: 12px; color: #333333; background: #ffffff;"&gt;A123456-&lt;SPAN style="text-decoration: underline;"&gt;01&lt;/SPAN&gt;-123456789-ABC. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which means it has to be always 01 any other value than 01 the sy-subrc should not be zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will also be thankful if you could share me the document(s) which help us write the above patterns( &lt;SPAN style="color: #333333; font-family: 'courier new', courier; font-size: 12px;"&gt;'^\w\d{6}-\d{2}-\d{9}-\d{3}$' ; &lt;SPAN style="color: #333333; font-family: 'courier new', courier; font-size: 12px;"&gt;'^\w\d{6}-\d{2}-\d{9}-\w{3}$'&lt;/SPAN&gt; ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'courier new', courier; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: 'courier new', courier; font-size: 12px;"&gt;In the meanwhile I will also do some R&amp;amp;D with your reply to solve the failed scenario.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Depp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 09:57:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395732#M1842113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-26T09:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Write REGEX for a string pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395733#M1842114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use this snippet then.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;'^\w\d{6}-01-\d{9}-.{3}$'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S33"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S33"&gt;To learn this, you can read F1 help on REGEX keyword, play around with program DEMO_REGEX_TOY and search internet for regular expression examples.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 11:03:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395733#M1842114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-26T11:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Write REGEX for a string pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395734#M1842115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll test and come back ..:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jul 2014 12:42:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-regex-for-a-string-pattern/m-p/10395734#M1842115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-02T12:42:17Z</dc:date>
    </item>
  </channel>
</rss>

