RegEx for Numbers

RegEx for Numbers

This script should report "good" but is failing. I need a function that tests if a string starts with a number.

  1. string test()
  2. {
  3.     street = "12 yadda";
  4.     if (!(street.matches("^\d+")))
  5.     {
  6.         yo = "bad";
  7.     }
  8.     else
  9.     {
  10.         yo = "good";
  11.     }
  12.     return yo;
  13. }

Cheers,
John Whitney