Mathieu Saby
Mathieu Saby

Reputation: 125

Regex: possible to match repeated patterns in openrefine?

In openrefine I'm trying, for example, to get all the occurences of [aeio]+ in "abeadsabmoloei", in an array : ["a","ea","a","o","oei"] Let's suppose we don't know the content of the string. Is it possible with match function?

Upvotes: 1

Views: 101

Answers (1)

Ettore Rizza
Ettore Rizza

Reputation: 2830

The match() function is not made to find multiple instances of a pattern in the same string. This is why a discussion is under way to implement a find() or findAll() function. In the meantime, two lines of Python/Jython will do the trick:

import re
return re.findall(r"[aeio]+", value)

enter image description here

Upvotes: 2

Related Questions