---
lang: en
title: 'API docs: rest.getpathvariables'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest
permalink: /doc/en/lb4/apidocs.rest.getpathvariables.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [getPathVariables](./rest.getpathvariables.md)

## getPathVariables() function

Get all path variables. For example, `/root/{foo}/bar` =<!-- -->&gt; `['foo']`

**Signature:**

```typescript
export declare function getPathVariables(path: string): RegExpMatchArray | null;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

path


</td><td>

string


</td><td>


</td></tr>
</tbody></table>

**Returns:**

RegExpMatchArray \| null


