解决方案 »

  1.   

    <html>
    <head>
    <title> </title>
    </head>
    <head></head>
    <body>
    <script type = "text/javascript">
    var str = "102-TRIAL-ownerusername 163,215-TRIAL-owneruserid 13";
    str1 = str.replace(/[A-Z\d-\s]/g,'');
    console.log(str1); </script>
    </body>
    </html>
      

  2.   

     var str = "102-TRIAL-ownerusername 163,215-TRIAL-owneruserid 13";
     var re=/([a-z]+)/g;
     var arr = str.match(re);
     console.log(arr)
      

  3.   


    var str = '102-TRIAL-ownerusername 163,215-TRIAL-owneruserid 13';
    var reg = /(\w*(?=\s))/;
    var result = reg.exec().join(',');
    console.log(result);