numbers and a full stop regular expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phpmel
    New Member
    • Oct 2007
    • 69

    numbers and a full stop regular expression

    hi guys,

    how can I validate a textbox with a reg exp validator that says that the textbox must have only digits and no more than one full stop....I am testing for a float.......eg
    the user can enter 4, 69, 60.356,7.3,2456 4

    can some one please help me with this expression
  • Mr Gray
    New Member
    • Apr 2008
    • 47

    #2
    Look at:



    It is a great place to learn Regular Expression and search for ones that may fit what you need.

    Comment

    • shweta123
      Recognized Expert Contributor
      • Nov 2006
      • 692

      #3
      Hi,

      Which platform are you using ?
      You can try this regular expression for checking the float numbers :

      RegexOptions options = RegexOptions.No ne;
      Regex regex = new Regex(@"^(\d)*( \.)(\d)*$", options);

      Comment

      Working...