On Sep 15, 11:19 pm, Yakov <[email protected]> wrote:
> > name: "list",
> > match: "^(?:[\\*#;:]+)",
> > lookaheadRegExp: /^(?:(?:(\*)|(#)|(;)|(:))+)/mg,
> > termRegExp: /(\n)/mg,
>
> Ok, here we have a "name" property with an obvious meaning; the
> "match" one means somewhat like "the beginning of the inside-list
> text" and the "termRegExp" one means "the end of the inside-list
> text", correct? On the other hand, I'm not sure about this in the
> following sense: if one writes smth like

match: "^(?:[\\*#;:]+)",

first off all .. * within a regExp means "repeat 0 or unlimited times,
as many times as possible"

because we want it, to be the char * we need to excape it. This is
done in regExp with \* -> char *.

But ... the whole stuff is inside a javaScript string "..." a single \
is used as an escape character in js string ( you can test this in
your browsers console.)
eg:
var x = "\"";
will print a single ".

so to create a * char for a regExp inside a js string you need to do
match: "\\*"
because otherwise it has a different meaning .. :)

match: "^(?:[\\*#;:]+)",

^             // Assert position at the beginning of a line (at
beginning of the string or after a line break character)
(?:           // Match the regular expression below
   [\\*#;:]       // Match a single character present in the list
below
                        // A * character
                        // One of the characters “#;:”
      +             // Between one and unlimited times, as many times
as possible, giving back as needed (greedy)
)

The match is __only__ used to identify the start of a list. For more
info about regExp, I recomend [1] regular-expressions.info (the site).
The above explanation is created by regexbuddy sw [2]

have fun!
mario

[1] http://www.regular-expressions.info/tutorial.html
(Disclaimer: I am not associated with this company. But there "regEx
buddy"[2] is a damn good programm, to test and create regExp's)
[2] http://www.regular-expressions.info/regexbuddy.html

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to