3 Replies Latest reply on Mar 2, 2009 3:11 AM by nikos101

    Could you help me with this regex :)

    nikos101 Level 2
      HI people, could you help me with this regex. I am trying to remove the last number after the 3rd decimal point in an IP:

      var ip:String = this.parameters.localIP;
      var myPattern:RegExp = /(d{1,3}\.\d{1,3}\.\d{1,3}\.)(\d{1,3})/;
      var str:String = ip.replace(myPattern, "$1");

      However the str variable still contains the original ip after this code runs.