gkunter / coquery

Coquery is a free corpus query tool for linguists, lexicographers, translators, and anybody who wishes to search and analyse a text corpus.
GNU General Public License v3.0
18 stars 4 forks source link

EXTRACT function should extract regex groups #255

Closed gkunter closed 7 years ago

gkunter commented 7 years ago

The EXTRACT function uses regular expressions which can include groups, but it returns only the whole matching string, not the groups. Instead, it should return one column for each match, or at least return the value of the first group.

Test case: Buckeye corpus, query string ible, string function EXTRACT(Transcript, "([AEIOU].) B [\w\s]{0,2}.?L$").

This returns IH B EL for P AA S IH B EL. Instead, it should return IH.