Doubt regex use information after the "_"

-2

I have the string:

NeName  =  MGLUE_EPCVMH_UGW01

I need the first 3 letters after the first "_" Can you help me?

    
asked by anonymous 29.08.2018 / 20:22

1 answer

2

The regular expression is as follows:

_(.{3})

Here's a Javascript test that shows how it works:

var str = 'NeName = MGLUE_EPCVMH_UGW01';
var regex = /_(.{3})/m;
var match = regex.exec(str);
console.log(match[1]);
    
29.08.2018 / 20:31