Какой-то несвязный вопрос. Ну, допустим так:
const urls = [
'/page/profile',
'/page/article/123123',
'/page/article/new',
'/page/article',
'/page/some/nested/structure/here',
'/page/module/article/new'
];
for (const url of urls ) {
const expression = /^\/page\/(.*)?(article)(.*)?$/g;
console.log(url, expression.test(url));
}
/*
'/page/profile' false
'/page/article/123123' true
'/page/article/new' true
'/page/article' true
'/page/some/nested/structure/here' false
'/page/module/article/new' true
*/