Note that there are some explanatory texts on larger screens.

plurals
  1. POREGEX to identify only plain text
    primarykey
    data
    text
    <p>I am working in VBA and have a regex to identify a pattern ASA1234ss. I am converting certain pattern of item in inbox to urls.</p> <pre><code>Body=objItem.HTMLBody With RegX .Pattern = "ASA[0-9][0-9][0-9][0-9][a-z][a-z]" .Global = True .IgnoreCase = Not MatchCase End With 'Replacing the pattern with a hyperlink Body = RegX.Replace(Body, "&lt;a href='http://www.stack.com=$&amp;'&gt;$&amp;&lt;/a&gt;") objItem.HTMLBody = Body </code></pre> <p>This works good in replacing the pattern only once. But when I again execute the macro, the hyperlinked patterns again gets replaced with same text appending to it.</p> <p>For Eg:</p> <p>Sample Input </p> <pre><code>ASA8765jd ASA7765jh ASA8873hi </code></pre> <p>First Execution</p> <pre><code>&lt;a href='http://www.stack.com=ASA8765jd'&gt;ASA8765jd&lt;/a&gt; &lt;a href='http://www.stack.com=ASA7765jh'&gt;ASA7765jh&lt;/a&gt; &lt;a href='http://www.stack.com=ASA8873hi'&gt;ASA8873hi&lt;/a&gt; </code></pre> <p>Second Execution</p> <pre><code>&lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=ASA8765jd'&gt;ASA8765jd&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=ASA8765jd'&gt;ASA8765jd&lt;/a&gt;&lt;/a&gt; &lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=ASA7765jh'&gt;ASA7765jh&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=ASA7765jh'&gt;ASA7765jh&lt;/a&gt;&lt;/a&gt; &lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=ASA8873hi'&gt;ASA8873hi&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=ASA8873hi'&gt;ASA8873hi&lt;/a&gt;&lt;/a&gt; </code></pre> <p>Third Execution</p> <pre><code>&lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=ASA8765jd'&gt;ASA8765jd&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=ASA8765jd'&gt;ASA8765jd&lt;/a&gt;&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=ASA8765jd'&gt;ASA8765jd&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=ASA8765jd'&gt;ASA8765jd&lt;/a&gt;&lt;/a&gt;&lt;/a&gt; &lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=ASA7765jh'&gt;ASA7765jh&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=ASA7765jh'&gt;ASA7765jh&lt;/a&gt;&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=ASA7765jh'&gt;ASA7765jh&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=ASA7765jh'&gt;ASA7765jh&lt;/a&gt;&lt;/a&gt;&lt;/a&gt; &lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=ASA8873hi'&gt;ASA8873hi&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=ASA8873hi'&gt;ASA8873hi&lt;/a&gt;&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=&lt;a href='http://www.stack.com=ASA8873hi'&gt;ASA8873hi&lt;/a&gt;'&gt;&lt;a href='http://www.stack.com=ASA8873hi'&gt;ASA8873hi&lt;/a&gt;&lt;/a&gt;&lt;/a&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload