<script>
     var str = '1-S1-002';
    alert(str.match(/^\w+[-]\w+/)); //1-S1    
</script>