regex-opt: use libstdc++

Fixes #26104.