Skip to main content
added 772 characters in body
Source Link

PowerShell, 56 bytes

Takes a single number as a string; outputs 0 for other, 3 for integer, and 4 for float

("$args"-match"^-?(0|[1-9]\d*)(\.\d+)?$")+$matches.Count

Try it online!

PowerShell (Alternate Regex), 56 bytes

("$args"-match"^-?((?!0)\d+|0)(\.\d+)?$")+$matches.Count

Try it online!

PowerShell, 56 bytes

Takes a single number as a string; outputs 0 for other, 3 for integer, and 4 for float

("$args"-match"^-?(0|[1-9]\d*)(\.\d+)?$")+$matches.Count

Try it online!

PowerShell, 56 bytes

Takes a single number as a string; outputs 0 for other, 3 for integer, and 4 for float

("$args"-match"^-?(0|[1-9]\d*)(\.\d+)?$")+$matches.Count

Try it online!

PowerShell (Alternate Regex), 56 bytes

("$args"-match"^-?((?!0)\d+|0)(\.\d+)?$")+$matches.Count

Try it online!

Source Link

PowerShell, 56 bytes

Takes a single number as a string; outputs 0 for other, 3 for integer, and 4 for float

("$args"-match"^-?(0|[1-9]\d*)(\.\d+)?$")+$matches.Count

Try it online!