Until hit a number

var str = 'aaaaa-bbb-z-y-x-123[abxyz]';

// aaaaa-bbb-z-y-x-
var name = /[^0-9]*/g.exec(str);

Refs

RegExr

Worthy of Note

Worthy of Note is a site aimed at Web Designers & Developers. It offers a wide range of resources to help assist anyone in the web industry.

View