```ruby
"prz_test_test.test".match(/(.*)(_.*\..*)$/)[1]
```
The first match is ```prz_test```.