match() and regex

25 views
Skip to first unread message

Robert Garrigos

unread,
Oct 24, 2022, 2:15:14 PM10/24/22
to openrefine
Hi,

I'm trying to use match() with some regex expression which I know they
work, but not with match. The regex expressions is:

/\(.*\)/

https://regex101.com/r/h2KjWD/1

which should return anything enclosed within parenthesis.

Why this simple regex is not working with match()?

Thanks.
--
========================
Robert Garrigós i Castro
https://garrigos.cat
+34 620 91 87 01

Tom Morris

unread,
Oct 24, 2022, 2:44:47 PM10/24/22
to openr...@googlegroups.com
You probably want to use find() (or include capture groups in your regex).

Tom

match(string s, regex p)
renvoie: array of strings
Attempts to match the string s in its entirety against the regex pattern p and, if the pattern is found, outputs an array of all capturing groups (found in order).

find(string s, substring or regex p)
renvoie: array of strings
Outputs an array of all consecutive substrings inside string s that match the substring or regex pattern p. You can supply a substring by putting it in quotes.


--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/e3f4d73f-a4d9-af31-5e6e-f5c2a50a8d1c%40garrigos.cat.

Robert Garrigos

unread,
Oct 24, 2022, 4:33:49 PM10/24/22
to openrefine

Thad Guidry

unread,
Oct 24, 2022, 11:37:16 PM10/24/22
to openr...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages