<?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: Need help in Regular expressions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348020#M6678</link>
    <description>&lt;P&gt;You can play with program DEMO_REGEX_TOY.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2016 10:17:44 GMT</pubDate>
    <dc:creator>retired_member</dc:creator>
    <dc:date>2016-11-23T10:17:44Z</dc:date>
    <item>
      <title>Need help in Regular expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348015#M6673</link>
      <description>&lt;P&gt;Hello experts, &lt;/P&gt;&lt;P&gt;I need help with the regular expressions. I have tried my best but could not achieve. My requirement 
is to check a variable for pattern like number + alphabet i.e 12c, 150b, 2500c, 1b
Last digit should always be either c or b, there should be only a number before b or c.
Please help me in this regard. &lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Petru&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 20:52:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348015#M6673</guid>
      <dc:creator>former_member261348</dc:creator>
      <dc:date>2016-11-22T20:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in Regular expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348016#M6674</link>
      <description>&lt;P&gt;This can be done by some simple conditions as below.&lt;/P&gt;&lt;P&gt;For e.g. your alphanumeric variable is p_test below logic can be used to check the condition&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: lv_len TYPE i,
      lv_last TYPE i,
      p_test type char20.

CONDENSE p_test.
lv_len = STRLEN( p_test ).
lv_last = lv_len - 1.

IF p_test+0(lv_last) CO '1234567890' AND
( p_test+lv_last(lv_len) EQ 'B' OR p_test+lv_last(lv_len) EQ 'C' ).
.....
...
..
...
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 21:12:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348016#M6674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-22T21:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in Regular expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348017#M6675</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;[[:digit:]]+[bc]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;\d+[bc]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;or &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;[0-9]+[bc]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Both [[:digit:]] and \d mean the same thing and is essentially the same as [0-9] meaning any number between 0 and 9. The '+' means 1 or more occurrences; if you want zero or more, use '*' instead. The [bc] means either b or c.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 21:47:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348017#M6675</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2016-11-22T21:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in Regular expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348018#M6676</link>
      <description>&lt;P&gt;And you get a short dump - At the end what you are doing for a 15 digit pattern (example: 12345678901234c) is p_test+14(15). You will get an error CX_SY_RANGE_OUT_OF_BOUNDS. Even with this the IF statement should be...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF p_test+0(lv_last) CO '1234567890' AND
( p_test+lv_last(1) EQ 'B' OR p_test+lv_last(1) EQ 'C' ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 22:04:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348018#M6676</guid>
      <dc:creator>raghug</dc:creator>
      <dc:date>2016-11-22T22:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in Regular expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348019#M6677</link>
      <description>&lt;P&gt;If you want to match e.g. 123c but not a123c then you should add the \b (word boundary) token. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;\b[0-9]+[bc]\b&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But there are a lot of more possibilities which you can best explore in one of the numerous online regex tester sides like &lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/" target="test_blank"&gt;https://regex101.com/&lt;/A&gt; as regex expressions are not an ABAP topic only &lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 22:11:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348019#M6677</guid>
      <dc:creator>former_member183045</dc:creator>
      <dc:date>2016-11-22T22:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need help in Regular expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348020#M6678</link>
      <description>&lt;P&gt;You can play with program DEMO_REGEX_TOY.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:17:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-in-regular-expressions/m-p/348020#M6678</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2016-11-23T10:17:44Z</dc:date>
    </item>
  </channel>
</rss>

