+++
# -----------------------------------------------------------------------
# Do not edit this file. It is automatically generated by API Documenter.
# -----------------------------------------------------------------------
title = "stringToJsRegex"
keywords = ["grafana","documentation","sdk","@grafana/data"]
type = "docs"
+++

## stringToJsRegex() function

### stringToJsRegex() function

<b>Signature</b>

```typescript
export declare function stringToJsRegex(str: string): RegExp;
```
<b>Import</b>

```typescript
import { stringToJsRegex } from '@grafana/data';
```
<b>Parameters</b>

|  Parameter | Type | Description |
|  --- | --- | --- |
|  str | <code>string</code> |  |

<b>Returns:</b>

`RegExp`

