Sorting by documents beginning with "UserDefinedCharacters"?

Is there a way to sort a container by notes that I designate that begin with “ii”?

I typically have notes notes I consider important as beginning with “ii”? Is there a way to use a primary or secondary sort to allow these documents to be listed first? For example using regex: “^ii”. I realize I can easily create an agent to do this, however, was curious if I could use a sort method instead.

For example,Sorting a container in a structure something similar to this:

ii x note
ii y note
a note
b note
c note
d note

Thanks in advance
Tom

  1. Use an agent to set a numeric attribute TRUE iff a note begins with “ii”

Query: inside(/the container)
Action: if($Name.beginsWith(“ii”)) {$MyNumber=0;} else {$MyNumber=1;}

Now, sort on $MyNumber, with a secondary sort on $Name

Thank you Mark for your assistance.

Tom