6 Replies Latest reply on Sep 20, 2007 10:37 PM by kglad

    Need help in RegExp  AS 3.0

    AScracker Level 1
      Hi,

      var str:String ="123+31+21-25*5";
      var re:RegExp = /(\d+)/;
      var results:Array = str.split(re);
      trace(results)
      // ,123,+,31,+,21,-,25,*,5,*/

      //but if the string will be is ...
      var str:String ="123.5+31.5+21-25*5";
      var re:RegExp = /(\d+)/;
      var results:Array = str.split(re);
      trace(results)
      //,123,.,5,+,31,.,5,+,21,-,25,*,5,

      but i need to split like 123.5,+,31.5,-,21,5,*,5
      Actually i do't want to split the Dot(.)... bcoz i need to some Math Calcilation According to the user inputs
      Can any one help me for this issu