Keep in mind that macros are not "functions"... they don't "evaluate and return" the result... rather, macro processing only does 3 things:
A) replace instances of $param$ using values passed to the macro as arguments
B) replace instances of $(varname)$ using values defined outside the macro as variables
C) return the resulting content for possible further processing in the calling context
It is up to that calling context to determine if the macro result should be parsed further.
the result was actually the literal value, "^\d{6}<<now 0DD>>", which is then *rendered* by the calling context, causing the <<now>> macro to be processed, producing the *displayed* output of "^\d{6}01".
However, when that same macro result is used within the filter syntax:
... filter="[regexp:created<regExDateOfMonth>]" ...
the returned macro value is NOT rendered, but simply used as a parameter value for the regexp filter operator. Thus, the <<now>> macro it contains is left as a literal value.
Try this instead:
\define regExDateOfMonth() ^\d{6}$(dateOfMonth)$
<$vars dateOfMonth=<<now 0DD>> >
<$list filter="[regexp:created<regExDateOfMonth>]"\>
</$vars>
The main points:
1) First, $vars is used to store the *output* of the <<now>> macro (i.e., "01") in a variable, "dateOfMonth".
2) In the regExDateOfMonth() macro, the dateOfMonth variable is referenced using $(varname)$ syntax, which performs a *lexical substitution* of the stored value before returning the desired result (i.e., the regexp pattern using the actual month number in place of <<now 0DD>>).
That should do it. Let me know how it goes.
enjoy,
-e
Eric Shulman
TiddlyTools: Small Tools for Big Ideas!
InsideTiddlyWiki: The Missing Manuals