Mark,

Thanks, this led to the solution, but I think it was my code, not the 
method, I had used define to define the open/close.

FYI: Here is it now working

<$vars open-comment="/*"
  close-comment="*/">
<$list 
filter="[[$:/PSaT/author-styles/stylesheet]get[text]splitregexp[\n]prefix[.]]" 
variable=definition>
<$set name=classname value={{{ [<definition>split[ ]removeprefix[.]] }}}>
<$set name=description value={{{ 
[<definition>split<open-comment>last[]split<close-comment>] }}}>
definition=<<definition>><br>
classname=<<classname>> description=<<description>><hr>
</$set></$set>
</$list>
</$vars>

This is while parsing a css file with lines including
.n { font-weight: normal;} /* Normal fontweight */

And the result is now
definition=.n { font-weight: normal;} /* Normal fontweight */
 classname=n description=Normal fontweight 

Thanks again

I am working on a .classname select-able editor Toolbar button.

Regards
Tones


On Monday, 31 August 2020 11:00:28 UTC+10, Mark S. wrote:
>
> I'm not sure if you need regexpsplit for this. This worked for me:
>
> <$vars split1="/*" split2="*/">
>
> {{{ [{test}split<split1>nth[2]split<split2>nth[1]] }}}
> </$vars>
>
> where test contains
>
> This is some text with an /* embedded comment */ in it.
>
> If you really needed regexpsplit, then you would need to escape the 
> asterisk and probably also the forward slash e.g. \/\* 
>
>
>
> On Sunday, August 30, 2020 at 5:04:29 PM UTC-7, TW Tones wrote:
>>
>> Hi,
>>
>> Can someone please tell me the regexp so I can test for open and close 
>> comment in a line?
>>
>> eg;
>> something1 something2 /* comment */ something3
>>
>> I want to extract the content between /* and */ 
>>
>> eg splitregexp[/*]rest[]splitregexp[*/]first[]
>>
>> I can't define a macro containing /* as it is interpreted as a comment :(
>>
>>
>> Thanks in advance
>> Tones
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9809fd7f-efbf-4559-a74e-b0a7e7b972c7o%40googlegroups.com.

Reply via email to