Consider below example
<$list filter="[[!This is level 1]] [[!! This is level 2]] [[!!! This is level 3]]" variable=item>
<$list filter="[<item>splitregexp[\!]count[]subtract[1]]">
<<currentTiddler>>
</$list>
</$list>
Returns: 1 2 3
It counts the number of !
at the start of string to calculate the heading level!
What is the pattern if the input has a !
in the meddle (should be ignored) e.g.
[[!! This is amazing! level 2]]
This still should return 2.