Hi,
alas the Find-Macro and also the Extract-Macro fail in this job. This really seems to be an issue for a widget which can escape the square-bracket-problem.

I made a quick attempt to solve this problem with a widget matching for the css, with no success so far.

|/*\
title: $:/core/modules/macros/roles.js
type: application/javascript
module-type: macro
Making some replacements in Textinputs
\*/

(function(){
   /*jslint node: true, browser: true */
   /*global $tw: false */
   "use strict";

/*
Information about this macro
*/
  exports.name = 'roles';
  exports.params = [{ name: 'text'  }];
/*
Run the macro
*/
exports.run = function(text) {
      text = text.match("/\[.*?\]/g");
      return text
} ;
})();|


Seeing how complicated this problem is in wikitext, I think it would be usefull, to have such a thing as "Extract Links Widget".

Jan






Jan

Am 15.07.2019 um 10:01 schrieb Jan:
Hi Mark!
I have tried out your proposition but alas, the filter is not working the way I would like it to work: So far it looks for Tiddlers that have the field "myfield", it should look for Links in this field.

I have tired several variations with get[] and list[] to have the dialoguebut it nearly seems impossible to filter the result for [[square brackets.

Jan






Am 14.07.2019 um 22:51 schrieb Jan Johannpeter:
Hi Mark,
 thanks, again you saved my day!
I will implement this at once!
Jan

Mohammad <mohammad.rahm...@gmail.com <mailto:mohammad.rahm...@gmail.com>> schrieb am So. 14. Juli 2019 um 19:18:

    Hi Mark,
     I was surprised with this simple and elegant solution you
    proposed albeit the regxp is behind my knowledge! :-)

    Added to TW-Scripts.

    Cheers
    Mohammad


    On Sunday, July 14, 2019 at 9:21:42 PM UTC+4:30, Mark S. wrote:

        You need to put your expression in a separate variable:

        <$vars reg="(?g)\[\[.*?\]\]">
        <$list filter="[!is[system]regexp:myfield<reg>]"/>
        </$vars>

        I tested using field "myfield". I was surprised to find that
        there actually is a matching field at tiddlywiki.com
        <http://tiddlywiki.com>.

        Note that the regexp filter has its own notation for
        indicating a global search. I put it in, but don't really
        understand what use it has, since it is the tiddler that gets
        returned, not the field. So finding one match should be good
        enough.


        On Sunday, July 14, 2019 at 3:51:37 AM UTC-7, Jan wrote:

            Hi Mat,
            Unfortunately filtersyntax gets so terribly complicated
            when the param contains squarebrackets.
            This here causes a syntax error:
            [!is[system]regexp[/\[.*?\]/g]]

            And how do I enter the suffix for the field?
            -Jan




            Am 14.07.2019 um 12:03 schrieb Mat:
            >or else it would probably be veeery tricky to find them.

            Pah! I'm exaggerating. It is "just" a matter of creating
            the right regexp for it. Not that I could do it.

            <:-)
-- 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 tiddl...@googlegroups.com.
            To post to this group, send email to
            tiddl...@googlegroups.com.
            Visit this group at
            https://groups.google.com/group/tiddlywiki.
            To view this discussion on the web visit
            
https://groups.google.com/d/msgid/tiddlywiki/ebad32fa-60c1-4434-a943-350812eb47d7%40googlegroups.com
            
<https://groups.google.com/d/msgid/tiddlywiki/ebad32fa-60c1-4434-a943-350812eb47d7%40googlegroups.com?utm_medium=email&utm_source=footer>.
            For more options, visit https://groups.google.com/d/optout.

-- 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
    <mailto:tiddlywiki+unsubscr...@googlegroups.com>.
    To post to this group, send email to tiddlywiki@googlegroups.com
    <mailto:tiddlywiki@googlegroups.com>.
    Visit this group at https://groups.google.com/group/tiddlywiki.
    To view this discussion on the web visit
    
https://groups.google.com/d/msgid/tiddlywiki/3989d192-3218-4d29-8eef-114071e5fcc4%40googlegroups.com
    
<https://groups.google.com/d/msgid/tiddlywiki/3989d192-3218-4d29-8eef-114071e5fcc4%40googlegroups.com?utm_medium=email&utm_source=footer>.
    For more options, visit https://groups.google.com/d/optout.



--
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 post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5D2C5E2F.3030206%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to