5 Replies Latest reply on Oct 20, 2008 5:24 AM by (Rasmus_Olsen)

    Trim whitespace using RegExp?

      Dear all,

      var bleed="3 mm.";
      var reg=/(^\s+|\W+$)/g;
      var replace="";

      What I'm trying to do here is to trim away the "space" and the ".", leaving me with just "3mm". I've been fiddling with this for the last hour or so and it still doesn't work - any hints?

      Best wishes,