Hi Mark,

Thanks for clarification!


Best wishes
Mohammad


On Fri, Sep 6, 2019 at 8:59 AM 'Mark S.' via TiddlyWiki <
[email protected]> wrote:

> There's a difference in javascript between a regular expression, and a
> string that can be interpreted as a regular expression.
>
> If you notice at regex101, the input box has* / *at the start and end. So
> it's assuming a direct regular expression, like:
>
> */*^(([^/]+?)/){1}[^/]+?$*/*gm
>
> The slashes are used to indicate the start and end of the expression, and
> so any slashes in the middle not part of a character class throw an error.
>
> But we're actually passing a string here. So internally something like
> this is happening:
>
> var patt = new RegExp(*"^(([^/]+?)/){1}[^/]+?$"*) ;
>
> Since the forward slash is not needed to delimit the expression when the
> regular expression is created this way, it doesn't throw an error inside of
> TW.
> It's unfortunate that the tool at regex101 doesn't allow you to enter the
> expression as a string.
>
> -- Mark
>
>
>
> On Thursday, September 5, 2019 at 8:48:08 PM UTC-7, Mohammad wrote:
>>
>> TT,
>>  At https://regex101.com/ the below syntax return errors it needs the
>> slash character to be escaped!
>>
>> Please have a look
>>
>>
>> Best wishes
>> Mohammad
>>
>>
>> On Thu, Sep 5, 2019 at 4:05 PM @TiddlyTweeter <[email protected]>
>> wrote:
>>
>>> *Advanced use of the Negated Character Class*
>>>
>>> *Match titles with defined numbers of "/" slash*
>>> *^(([^/]+?)/){1}[^/]+?$*
>>>
>>> The  difference here is in *{1}*
>>>
>>> If you change the number then it will change the number of "/" permitted
>>> in the match.
>>>
>>> You can test it at:
>>> http://tw-regexp.tiddlyspot.com/#RegExp%20Experimentation%20with%20Title
>>>
>>>
>>> TT
>>>
>>> --
>>> 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/166333e8-b354-47a0-b685-b47886566827%40googlegroups.com
>>> <https://groups.google.com/d/msgid/tiddlywiki/166333e8-b354-47a0-b685-b47886566827%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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/7262fe0a-4a4b-402f-a094-f0cf3ee6f94f%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/7262fe0a-4a4b-402f-a094-f0cf3ee6f94f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAAV1gMBk6Hk3Z_Q5Rx%2B576zU_NqD8ydW7WMD1hcb4U3C_fhAJw%40mail.gmail.com.

Reply via email to