I realized that the solution I posted above only works for my use case 
where the tags are on a line of their own.

I am sure someone with better RegExp prowess can improve on this 
significantly, but this should work:

<$vars text="""this is some     aribrart text .. .etc. # ... @title1  
 @title2   @[[title with space]]""" 
reg="""(?:(?:@(\[\[.*[^\]]\]\]|\S+))|(?!@)\S+|\s)""">

{{{ [<text>search-replace:gi:regexp<reg>,[ $1]enlist-input[]] }}}

</$vars>


On Thursday, April 8, 2021 at 6:43:41 AM UTC+2 Saq Imtiaz wrote:

> Try this to get the tags (skip the enlist-input[] to keep them as one 
> string):
>
> <$vars text="""@title1   @title2   @[[title with space]]""" 
> reg="""@(\[\[.*[^\]]\]\]|\S+)""">
>
> {{{ [<text>search-replace:gi:regexp<reg>,[$1]enlist-input[]] }}}
>
> </$vars>
>
> I've played around with converting #title to tags in Streams using a 
> similar technique.
>
> On Thursday, April 8, 2021 at 3:12:27 AM UTC+2 [email protected] wrote:
>
>> Hello friends,
>>
>> I'm trying to take an input field that looks like:
>>
>> this is some     aribrart text .. .etc. # ... @title1   @title2   
>> @[[title with space]]
>>
>> and parse it to tag another created tiddler with title1, title2 and 
>> [[title with space]]. 
>>
>> Ive tried playing around with splitting by space, regexp for '@', etc but 
>> I cant seem to cleanly grab all titles. 
>>
>> Any help would be greatly appreciated! 
>>
>> Thanks,
>> Diego
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3916fdc9-28a2-4dbb-9e94-b9d51b622e8dn%40googlegroups.com.

Reply via email to