Post Reply 
Proposal : List of regular expressions for numeric syntax on different HP calculators
06-07-2019, 05:25 PM
Post: #1
Proposal : List of regular expressions for numeric syntax on different HP calculators
I'm interested in the syntax of what the user can enter as a number in various HP calculators. For the HP48 series, I think the regular expression is :

((([+-]?[0-9]+(\.)?[0-9]*)|([+-]?[0-9]*(\.)?[0-9]+))([eE](([+-]?[0-9]+(\.)?[0-9]*)|([+-]?[0-9]*(\.)?[0-9]+)))?)

which is quite convoluted. Here's a short Perl script that presents it in a more understandable way :

Code:
#!/usr/bin/perl

$a = "([+-]?[0-9]+(\\.)?[0-9]*)";
$b = "([+-]?[0-9]*(\\.)?[0-9]+)";
$c = "($a|$b)";
$d = "($c([eE]$c)?)";

while(<STDIN>)
{
    /$d/;
    print $1;
}

I'm interested in how the regular expressions used to match the user entered number formats differ in different HP Calculators. Perhaps we could compile a list of the different regular expressions Smile

Regards,

Jonathan

Aeternitas modo est. Longa non est, paene nil.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Proposal : List of regular expressions for numeric syntax on different HP calculators - Jonathan Busby - 06-07-2019 05:25 PM



User(s) browsing this thread: 1 Guest(s)