<?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: REGEX help needed in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340804#M1539419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Harald. &lt;/P&gt;&lt;P&gt;I tried this: REPLACE ALL OCCURRENCES OF REGEX '&amp;lt;(.+)&amp;gt;([^&amp;lt;]&lt;STRONG&gt;)&amp;lt;/&amp;gt;' IN ls_lines WITH '&amp;lt;$1&amp;gt;$2&amp;lt;/$1&amp;gt;', but it replaces the string with '&lt;/STRONG&gt;', that's it. &lt;/P&gt;&lt;P&gt;What can be going wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Nov 2010 04:53:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-11-03T04:53:30Z</dc:date>
    <item>
      <title>REGEX help needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340802#M1539417</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 have a text (from Read_text) which comes like this : .... &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; &amp;lt;H&amp;gt;... &amp;amp;lt;/&amp;amp;gt; ....&amp;lt;T&amp;gt;...&amp;amp;lt;/&amp;amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Now in the closing &amp;lt;/&amp;gt;, I want to put back the alphabet that started angular bracket. So above should become like this:&lt;/P&gt;&lt;P&gt;...&amp;lt;H&amp;gt;...&amp;lt;/H&amp;gt;.... &amp;lt;T&amp;gt;...&amp;lt;/T&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although I have made a logic for it, I feel a REGEX can do the job for me in 1-2 lines and would be much more efficient, since my text can be very long. But unfortunately my REGEX knowledge is too weak to do it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice please? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in adv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Aishi A on Nov 3, 2010 9:30 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 01:19:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340802#M1539417</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-03T01:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340803#M1539418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following should do the trick assuming that &lt;SPAN __default_attr="Courier New" __jive_macro_name="font"&gt;S&lt;/SPAN&gt; is a character type variable holding your data:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
replace all occurrences of regex '&amp;lt;(H|T)&amp;gt;([^&amp;lt;]*)&amp;lt;/&amp;gt;' in S with '&amp;lt;$1&amp;gt;$2&amp;lt;/$1&amp;gt;'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Check out the online help on [regular expressions|http://help.sap.com/abapdocu_70/en/ABENREGEX_SYNTAX.htm] to understand what's going on (or for a quicker way access directly the page [special characters in regular expressions|http://help.sap.com/abapdocu_70/en/ABENREGEX_SYNTAX_SPECIALS.htm]). I leave it up to you to figure out the limitations and possible required adaptions to make it work for all your input cases (e.g. if you want it more generic start with &lt;SPAN __default_attr="Courier New" __jive_macro_name="font"&gt;&amp;lt;(.+)&amp;gt;&lt;/SPAN&gt; instead of the specific H or T)... &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 01:59:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340803#M1539418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-03T01:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340804#M1539419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Harald. &lt;/P&gt;&lt;P&gt;I tried this: REPLACE ALL OCCURRENCES OF REGEX '&amp;lt;(.+)&amp;gt;([^&amp;lt;]&lt;STRONG&gt;)&amp;lt;/&amp;gt;' IN ls_lines WITH '&amp;lt;$1&amp;gt;$2&amp;lt;/$1&amp;gt;', but it replaces the string with '&lt;/STRONG&gt;', that's it. &lt;/P&gt;&lt;P&gt;What can be going wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 04:53:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340804#M1539419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-03T04:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340805#M1539420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try to check your posting after submitting it - I'm not quite sure if the forum software interpreted some of your coding as markup and thus messed up your message...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyhow, my comment on a more generic replacement was a bit quick and thus wrong; here's the real more generic version (we have to prevent the first subgroup match from "running away"):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;replace all occurrences of regex '&amp;lt;([^&amp;gt;]+)&amp;gt;([^&amp;lt;]*)&amp;lt;/&amp;gt;' in S with '&amp;lt;$1&amp;gt;$2&amp;lt;/$1&amp;gt;'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The regular expression works fine for me and is correct; if it doesn't work on your end check if you're using the same line and also check the links I've given for further reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 11:55:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340805#M1539420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-03T11:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX help needed</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340806#M1539421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bang on Harald. Works perfectly!&lt;/P&gt;&lt;P&gt;Thanks a ton.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Nov 2010 01:08:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regex-help-needed/m-p/7340806#M1539421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-04T01:08:05Z</dc:date>
    </item>
  </channel>
</rss>

