Select SIMILAR based upon a file's last extension

I'd like a way to use Select SIMILAR but to only consider the file's last extension (when a file has a double-extension).

For example, a way to select all of these at once:

archive file.part1.rar
archive file.part3.rar
archive file.part2.rar

Currently, the part# section is causing Select SIMILAR to be unable to select the others.


- Directory Opus v12.23.4 Beta x64 Build 7769
- Windows 10 v20H2 OS Build 19042.906
function OnClick(clickData)
	var cmd = clickData.func.command;
	cmd.deselect = false;
	for (var eSel = new Enumerator(clickData.func.sourcetab.selected); !eSel.atEnd(); eSel.moveNext())
		if (!eSel.item().is_dir && eSel.item().ext != "")
			cmd.RunCommand('Select PATTERN="*' + eSel.item().ext + '"');

XML for pasting to a toolbar:

<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>New Button</label>
	<function type="script">
		<instruction>@script JScript</instruction>
		<instruction>function OnClick(clickData)</instruction>
		<instruction>	var cmd = clickData.func.command;</instruction>
		<instruction>	cmd.deselect = false;</instruction>
		<instruction>	cmd.ClearFiles();</instruction>
		<instruction>	for (var eSel = new Enumerator(clickData.func.sourcetab.selected); !eSel.atEnd(); eSel.moveNext())</instruction>
		<instruction>	{</instruction>
		<instruction>		if (!eSel.item().is_dir &amp;&amp; eSel.item().ext != &quot;&quot;)</instruction>
		<instruction>		{</instruction>
		<instruction>			cmd.RunCommand(&apos;Select PATTERN=&quot;*&apos; + eSel.item().ext + &apos;&quot;&apos;);</instruction>
		<instruction>		}</instruction>
		<instruction>	}</instruction>