---
title: regexp.splitRegexp() function
description: regexp.splitRegexp() splits a string into substrings separated by regular expression matches and returns an array of i substrings between matches.
url: https://docs.influxdata.com/flux/v0/stdlib/regexp/splitregexp/
estimated_tokens: 685
product: Flux
version: v0
---

# regexp.splitRegexp() function

-   Flux 0.33.0+
-   View InfluxDB support

`regexp.splitRegexp()` splits a string into substrings separated by regular expression matches and returns an array of `i` substrings between matches.

##### Function type signature

```js
(i: int, r: regexp, v: string) => [string]
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### r

(Required) Regular expression used to search `v`.

### v

(Required) String value to be searched.

### i

(Required) Maximum number of substrings to return.

\-1 returns all matching substrings.

## Examples

### Return an array of regular expression matches

```js
import "regexp"

regexp.splitRegexp(r: /a*/, v: "abaabaccadaaae", i: -1)// Returns ["", "b", "b", "c", "c", "d", "e"]

```

#### Related

-   [Work with regular expression types](/flux/v0/data-types/basic/regexp/)
