<?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: How do I append a literal digit (e.g., &amp;quot;0&amp;quot;) after a regex capture group in JMP? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894658#M105535</link>
    <description>&lt;P&gt;Yes, excellent, this appears to be the most canonical response, e.g. replace "en(\d+)" with "\1\e0".&amp;nbsp; That works, and follows the same pattern as "\U" and other special characters in replace-strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(For the probably-less-than-3 people who read this and are wondering what "\U" does, it allows you to do case changes on the replace string, e.g. if you had a list of names in a column, and wanted to change "Harris, Bryan" to "HARRIS, Bryan", you could do by with finding "(.+)(,.+)" and replacing it with "\U\1\E\2".&amp;nbsp; "\U" and "\L" are uppercase and lowercase respectively, and they operate until the next "\E".&amp;nbsp; You can also do a case-change on just the first letter with "\l" and "\u", terminating with "\e".&amp;nbsp; I cannot find any mention of these in the documentation, but it may be that I just don't know where to look.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
    <pubDate>Fri, 15 Aug 2025 15:32:27 GMT</pubDate>
    <dc:creator>BHarris</dc:creator>
    <dc:date>2025-08-15T15:32:27Z</dc:date>
    <item>
      <title>How do I append a literal digit (e.g., "0") after a regex capture group in JMP?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894391#M105514</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="497" data-end="630"&gt;I'm using regular expressions in JMP Recode's "Replace String" function to transform strings like &lt;CODE data-start="606" data-end="614"&gt;"en127"&lt;/CODE&gt; into &lt;CODE data-start="620" data-end="627"&gt;"1270"&lt;/CODE&gt;.&amp;nbsp; My approach is to capture the two digits using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="overflow-visible!" data-start="681" data-end="706"&gt;&lt;CODE class="whitespace-pre!"&gt;&lt;SPAN&gt;Find:    en(\d+)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P data-start="708" data-end="730"&gt;But when I try to use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE class="overflow-visible!" data-start="732" data-end="752"&gt;&lt;CODE class="whitespace-pre!"&gt;&lt;SPAN&gt;&lt;SPAN class="hljs-section"&gt;Replace: \10&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P data-start="754" data-end="847"&gt;…it is interpreted as a reference to &lt;STRONG data-start="791" data-end="803"&gt;group 10&lt;/STRONG&gt;, not &lt;STRONG data-start="809" data-end="846"&gt;group 1 followed by a literal "0"&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P data-start="849" data-end="874"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="849" data-end="874"&gt;Is there a way in JMP to a&lt;SPAN&gt;ppend a literal &lt;/SPAN&gt;&lt;CODE data-start="894" data-end="899"&gt;"0"&lt;/CODE&gt;&lt;SPAN&gt; (or any literal digit) after a capture group w&lt;/SPAN&gt;&lt;SPAN&gt;ithout it being misinterpreted as a higher-numbered group?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P data-start="1012" data-end="1166"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="1012" data-end="1166"&gt;Other engines (like Perl or JavaScript) let you disambiguate with braces or dollar signs (e.g., &lt;CODE data-start="1108" data-end="1115"&gt;${1}0&lt;/CODE&gt;), but JMP doesn't seem to support those.&lt;/P&gt;
&lt;P data-start="1168" data-end="1253"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="1168" data-end="1253"&gt;I’d prefer a one-step solution, not one that requires a second replace operation.&lt;/P&gt;
&lt;P data-start="1255" data-end="1300"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="1255" data-end="1300"&gt;Any insight on how to do this cleanly in JMP?&lt;/P&gt;
&lt;P data-start="1302" data-end="1309"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="1302" data-end="1309"&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 13:20:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894391#M105514</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2025-08-14T13:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I append a literal digit (e.g., "0") after a regex capture group in JMP?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894411#M105515</link>
      <description>&lt;P&gt;Away from computer so I can't look it up right now. I think you can use another escape after the \1 that won't do anything special. I think there's some escapes for upper casing and lower casing and things of that nature. Edit: if there is a code to upcase the next char that would be perfect since it would not change the next digit.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 14:48:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894411#M105515</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-08-14T14:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I append a literal digit (e.g., "0") after a regex capture group in JMP?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894427#M105516</link>
      <description>&lt;P&gt;So for example, using \L (single character that is not lowercase &lt;SPAN class="code"&gt;[^a-z]&lt;/SPAN&gt;)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1755187427028.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/80349i0B415EEEB53E2898/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1755187427028.png" alt="jthi_1-1755187427028.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.2/#page/jmp/escaped-characters-in-regular-expressions.shtml#" target="_blank" rel="noopener"&gt; Scripting Guide &amp;gt; Types of Data &amp;gt; Regular Expressions &amp;gt; Escaped Characters in Regular Expressions&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2025 16:04:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894427#M105516</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-08-14T16:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I append a literal digit (e.g., "0") after a regex capture group in JMP?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894508#M105524</link>
      <description>&lt;P&gt;\e (lower case e) was designed for this in a replacement. (not in a pattern match where it matches the escape character.)&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Regex-backreference-followed-by-a-number-unambiguous/m-p/714744/highlight/true#M89807" target="_blank"&gt;https://community.jmp.com/t5/Discussions/Regex-backreference-followed-by-a-number-unambiguous/m-p/714744/highlight/true#M89807&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="Back Reference" uid="21267" url="https://community.jmp.com/t5/Uncharted/Back-Reference/m-p/21267#U21267" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4160"&gt;@shannon_conners&lt;/a&gt;&amp;nbsp;The doc&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp; points to has unfortunately mixed the &lt;EM&gt;parameter 2&lt;/EM&gt; matching grammar with the &lt;EM&gt;parameter 3&lt;/EM&gt; replacement grammar; \L etc has different usage in the two places. \L matches a not-lower-case character in &lt;EM&gt;parameter 2&lt;/EM&gt; and begins lower casing in a replacement string. Same for \u \U and \l. Also \E \Q only belong in &lt;EM&gt;parameter 3&lt;/EM&gt; replacements.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 00:11:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894508#M105524</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-08-15T00:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I append a literal digit (e.g., "0") after a regex capture group in JMP?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894658#M105535</link>
      <description>&lt;P&gt;Yes, excellent, this appears to be the most canonical response, e.g. replace "en(\d+)" with "\1\e0".&amp;nbsp; That works, and follows the same pattern as "\U" and other special characters in replace-strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(For the probably-less-than-3 people who read this and are wondering what "\U" does, it allows you to do case changes on the replace string, e.g. if you had a list of names in a column, and wanted to change "Harris, Bryan" to "HARRIS, Bryan", you could do by with finding "(.+)(,.+)" and replacing it with "\U\1\E\2".&amp;nbsp; "\U" and "\L" are uppercase and lowercase respectively, and they operate until the next "\E".&amp;nbsp; You can also do a case-change on just the first letter with "\l" and "\u", terminating with "\e".&amp;nbsp; I cannot find any mention of these in the documentation, but it may be that I just don't know where to look.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Aug 2025 15:32:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-append-a-literal-digit-e-g-quot-0-quot-after-a-regex/m-p/894658#M105535</guid>
      <dc:creator>BHarris</dc:creator>
      <dc:date>2025-08-15T15:32:27Z</dc:date>
    </item>
  </channel>
</rss>

