I'm attempting to use reg ex in jQuery to test whether or not a variable contains a specific pattern, if it does I'm attempting to trim the string. Here's is some pseudo code that details what I need.
var $test = 12345_4
if ($test contains '_[0-100]'){
remove '_' && [0-100]
// $test would equal 12345
}
else {
//do something
}
Is it possible to achieve something like this using jQuery? Thanks