# Regular Expression found in string to another column

**URL:** https://forum.cloverdx.com/t/regular-expression-found-in-string-to-another-column/1753
**Category:** CloverDX Platform
**Created:** [May 17, 2016, 12:00am UTC](https://forum.cloverdx.com/t/regular-expression-found-in-string-to-another-column/1753 "2016-05-17T00:00:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![abelgoodwin](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@abelgoodwin](https://forum.cloverdx.com/u/abelgoodwin)
#### Post date: [May 17, 2016, 12:00am UTC](https://forum.cloverdx.com/t/regular-expression-found-in-string-to-another-column/1753/1 "2016-05-17T00:00:00Z")

</div>

Hello!

I’m evaluating a metadata column for string like:

```auto
\d\d[\s-][A-Z\d]{2}[\s-][A-Z\d]{2}

```

I have loaded a few rows of data that are from the source in this tester so you can see the string I’m attempting to extract.  
[http://rubular.com/r/NgVdZWFESP](http://rubular.com/r/NgVdZWFESP)

The CTL in my reformat is as follows:

```auto
if (matches($in.0.Address,".*\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}.*") and contains(upperCase($in.0.Address),"ADD")) {
		$out.0.RNT_LOCATION = ""; //matchGroups($in.0.Address,"\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}")[0];
	}

```

The

```auto
".*\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}.*"

```

works fine, but when I try to use

```auto
"\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}"

```

as found in the matchGroups, in order to isolate the string pattern I want, it cannot find the regular expression in the string.

I’ve attempted using

```auto
"\\d\\d[\\s-][A-Z\\d]{2}[\\s-][A-Z\\d]{2}"

```

in a filter as well to see if it can find the regular expression in the string or not but I’m having no success returning rows.

How can I extract that string pattern into a metadata column as I’m attempting to do?

please let me know if I should update with more information or anything is unclear, thank you in advance.

---

<div class="post-metadata">

### Author: ![PedroVazquezRosario](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@PedroVazquezRosario](https://forum.cloverdx.com/u/PedroVazquezRosario)
#### Post date: [May 18, 2016, 8:44pm UTC](https://forum.cloverdx.com/t/regular-expression-found-in-string-to-another-column/1753/2 "2016-05-18T20:44:36Z")

</div>

Hi,

The best approach would be to use the _ **find** _ function instead of using match. You can utilize a **_Normalizer_** component or you can keep your _ **Reformat** _ component and edit your output metadata to be of container type list.
