> I considered [posting to the dev group], but frankly I hesitated
> because I have no idea what many of the posts over there are about
> or what their norms are, and I had a feeling that basic,
> not-TW-specific questions might not be considered appropriate there
No need to worry about that; generally speaking, we try to discuss very
technical issues (like below's somewhat obscure RegEx) in that setting.
> I tend to resist a character-scan approach. Once you open one up
> enough to allow decimals, signs etc., it also tends to pass things
> like "------", "....." and "834.234.343" which won't convert, or
> shouldn't, and code to tighten a character-scan approach beyond that
> level tends to get very elaborate and error-prone.
I can very much see where you're coming from - though in this case, that
might be (relatively) easy:
if(testStr.search(/^-?\d+(\.\d+)?$/) != -1) { ... }
Anyway, this is just presenting options; I'm sure your original approach
will be fine - and if you end up discovering a bug, we can worry about
that then.
-- F.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" 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/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---