- Experimentation tiddler was added to let freely play with regexp patterns
- Documentation improved
- Some patterns were improved.
* should not be used instead + as the latter needs to have at least one character so does not matches empty string while * matches empty string as it indicates zero or more symbols.* = match 0 or more times, as many times as possible ("greedy")*? = match 0 or more times, as few times as possible ("lazy")+ = match 1 or more times, as many times as possible ("greedy")+? = match 1 or more times, as few times as possible ("lazy")? = match 0 or one time{5} = match exactly 5 times{5,9} = match 5 to 9 times
\define snr-regex(match:" ", replace:"""-""", field:"text", case:"i", flags:"g", description:"A Regex")
<blockquote>
; $description$
: field: ''`$field$`'' flags: ''`$case$`'' ''`$flags$`''
: match: ''`$match$`''
: replace: ''`$replace$`''
<$button tooltip="load match and replace patterns">
<!-- load match and replace regex via inline macro -------------------------------------------->
load
<$action-setfield $tiddler="$:/state/commander/snr/select-tiddler/field" text=$field$ />
<$action-setfield $tiddler="$:/state/commander/snr/gm" text=$flags$ />
<$action-setfield $tiddler="$:/state/commander/snr/whole-words" text="" />
<$action-setfield $tiddler="$:/state/commander/snr/case-sensitive" text="""$case$""" />
<$action-setfield $tiddler="$:/state/commander/snr/replace-text" text="""$match$""" />
<$action-setfield $tiddler="$:/state/commander/snr/replace-text-with" text="""$replace$""" />
</$button>
</blockquote>
\end
\define snr-regex-apply(match, replace)
<$button tooltip="apply this pattern">
<!-- apply match & replace regex -->
apply / done
<$action-setfield $tiddler="$:/state/commander/snr/replace-text" text="""""" />
<$action-setfield $tiddler="$:/state/commander/snr/replace-text-with" text="""""" />
</$button>
\end
- Regexp Search Box lets to search in any tiddler fields
- More examples
- Tobias Beer was acknowledged for his great script search in field
"\b" = "word-boundary" is an anchor that is complementary to "\w".
\b is shorthand for "before or after the characters [a-zA-Z0-9_]".
In regular expressions "cat", "cat9", "cat_9" and "999" are all "words".
"Über" is NOT a word in regex because \b won't match accented letters.
On "Über" the regex (\b\w+\b) will return "ber".
So if you work in languages other than English this is good to know to save hassle.
TT
- Regexp Search in Fields improved
- A new search-regexp macro has been added which can be called anywhere.
- RegExp Experimentation with a Specified Field was added to let freely play with regexp patterns in a user defined field
- Search in Titles with Predefined Rexexp Patterns improved for documentation.
- Several sample patterns are added
\define macro-name()then list all "macro-names"Which can then be used to display the "current value" of that macro
Ie begins \defineone or more spacescapture the nameend of name when "(" is detected.
RegardsTonySearch a macro tiddler for macros of the form\define macro-name()then list all "macro-names"Which can then be used to display the "current value" of that macro
--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a52cac8d-d1bc-407d-9144-de6f8788b9aa%40googlegroups.com.
Hi TonyI have already published a macro to find all macros and show them in a useful format!Have a look at Yazd wiki!
--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/fb215b8e-0f18-466a-9c01-0d2a8e500438%40googlegroups.com.
.advancedsearch-tab
.attr
.button
.clink
.combokey
.controlpanel-tab
.deprecated-since
.dlink
.dlink-ex
.em
.example
.example-tab
.field
.flink
.from-version
.info-tab
.inline-operator-example
.js-macro-link
.key
.keycombo
.link
.lorem
.macro-examples
.mlink
.mlink2
.more-tab
.mtitle
.node-only-operator
.note
.olink
.olink2
.op
.operator-example
.operator-examples
.otitle
.param
.place
.preamble
.s-matching-is-case-sensitive
.sidebar-tab
.state-prefix
.strong
.tab
.tag
.this-is-operator-example
.this-is-static-link-variable
.this-is-toolbar-config-variable
.tid
.tip
.toc-lorem
.toc-tab
.using-days-of-week
.value
.var
.variable-examples
.vlink
.vlink2
.vtitle
.warning
.wid
.widget-examples
.wlink
.wlink2
.word
style-guide
tw-code
tw-code-link
wikitext-example
wikitext-example-without-html
.concat
.def
<$list filter="[all[]get[text]splitregexp[\n]regexp[^\\define]splitregexp[^\\define]!is[blank]]" variable="splitme">
{{{ [<splitme>splitregexp[\(.*?\)]first[]] }}}<br/></$list><table>
<tr>
<th>Macro</th>
<th>Defined in</th>
<th>Global (Tagged ~$:/tags/Macro)</th>
</tr>
<$list filter="[all[]sort[]]" variable=tiddlername>
<$list filter="[<tiddlername>get[text]splitregexp[\n]regexp[^\\define]splitregexp[^\\define]!is[blank]]" variable="splitme">
<tr>
<td><$text text={{{ [<splitme>splitregexp[\(.*?\)]first[]] }}}/></td>
<td><$link to=<<tiddlername>> ><$text text=<<tiddlername>>/></$link></td>
<td><$text text={{{ [<tiddlername>tag[$:/tags/Macro]then[Yes]else[No]] }}}/></td>
</tr>
</$list>
</$list>
</table>--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a3a521d1-677d-4702-b4fc-fe2fdb24c1ca%40googlegroups.com.
... a title and link to the containing tiddler as well.
--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3615b3f4-fdb6-483a-9319-e98126578f45%40googlegroups.com.
Hi Josiah,Good suggestion!I think I should write a book on Tiddlywiki :-)