How do you get greedy? All regex modifiers are greedy by default.
So how do you get non-greedy? Add a ?. Eg, “a.*?b”.
Can we use “RegEx” on the wiki? No, I don’t generally abbreviate things in formal documentation. Here is fine, use whatever you like, even RE on occasion is sufficient. Same for using “KM” for Keyboard Maestro.
Maybe there would be sense in duplicating the Glossary from the documentation on the wiki (probably not, but maybe), or add the term RegEx to the Glossary (probably).
You can see that the pattern match is greedy because the \d+ matches all three numbers “123”. If it was not greedy, it would match only 1.
You are talking about “global” not greedy. You cannot match globally in a Search Variable action - where would you put all the matches? If you want to match multiple times (globally), we all know what action to use whenever there are multiple things, right? The For Each action. Then you can iterate over all the RegEx matches using the Substrings In collection.
I never even thought to look in the Help menu. Since the Action help now takes us directly to the wiki, I think a reasonable expectation is that the wiki should be comprehensive. Am I wrong in thinking this?
Seems like a link to it should be on the major RegEx wiki pages.
I did search the wiki for every form of regular expressions, and it did not return "ICU Regular Expressions Reference"
This reference says:
The regular expression patterns and behavior are based on Perl's regular expressions.
This is the information we need we comparing with other sources on the Internet, and other RegEx tools.
ICU Regular Expressions are very similar to PCRE, but not identical. They are missing:
Recursion
Conditionals
Named Captures
Embedded Code
Yes, the wiki is not comprehensive. Neither is the documentation.
And there is no well defined devision either.
Perhaps I should abandon the documentation altogether and just put everything on the wiki, but that is not the current state. The wiki also has the disadvantage of not being per-version, so either every page has to have tags to say what changed when, or anyone using the old version just has to guess (which is a bit the way its going to end up anyway).
I like that. I very much like having only one place to search.
Carrying two versions in the wiki is complicated, and a PITA, I get that.
I wonder if this makes sense: If a page needs changing due to Ver 7, what if you copy the page, and mark each with their ver, and a link to the other page?
OR maybe you just direct all KM6 users to the standard documentation, and make the wiki pure KM7?
I also like to be able to put PDF documentation on my iPad, so I can read up on things when I'm off doing the hurry-up-and-wait routine somewhere.
I do believe there needs to be a page on regular expressions on the wiki. It need not be long or comprehensive, but it should briefly define what a regex is and provide a link to the ICU docs.
The damned search in the Help menu does not find things in the Help menu.
Long ago I searched for regular and regexin the Help menu's search field and didn't find it. I wrongly concluded it was't in the KM menu system, and Peter later corrected me.
That's how I learned of the Help menu's limitation.
Many people never read the titles in the help menu — sad to say.
Many people don't know you can search for menu items.
Peter — how about putting another separator in there to emphasize the ICU date and ICU Regex sections?
The problem is how to you keep the PDF up to date?
Seems to me for that to work, you would need an on-demand, wiki to PDF generator.
It is hard enough to maintain documentation in one place, much less 2 or 3.
And, as all good DB admins know, as soon as you have data in two places one of them will be wrong, or out of date.
At the moment Peter prints the online help file to PDF (available from the help page). Its links are not brought into the PDF unfortunately, but it's searchable.
That is true, but more and more of the documentation is moving to the wiki, which is making the actual documentation less complete, but the overall documentation more complete.
I have not yet concluded where this trend will end, but the removal of Actions, Tokens, Conditions, Collections, Functions has already reduced the documentation PDF significantly (about 20%).
[quote=“peternlewis, post:10, topic:1858”]more and more of the documentation is moving to the wiki, which is making the actual documentation less complete, but the overall documentation more complete.
[/quote]
Hey Peter,
The search on the wiki is pretty impressive — much better than in the KM help-viewer or the docs on the web — so one of my big reasons for wanting a PDF has gone away.
The most serious problem I’ve found on the wiki search is it does not handle equivalence of plurals. So search for “shortcut” and “shortcuts” find completely different results.