如何添加空格和标点符号以使用正则表达式捕获第一组?如何阻止某些选项卡在 LibreOffice 中分成两列?

How to add whitespace & punctuation marks to capture first group with regex? How to stop certain tabs dividing into two columns within LibreOffice?

任何人都可以帮助我。一直在努力让这个正则表达式工作,而且它快到了。好像都对,但是第一个应该是:

单词: el, la
性别:艺术
word_en: (+m, f)

第一个测试字符串是:

1

el, la art the (+m, f)
• el diccionario tenía también frases útiles – the dictionary also had
useful phrases
2055835 | 201481381

另一个问题是我一直在尝试简单地复制信息。从“替换”部分进入 LibreOffice。我想要做的就是为数据创建 6 列。问题是第 6 列 (sent_en) 有时会在“G”列和“A”列之间划分,而不是 sent_en 的所有数据都在“G”列中。如果您将“替换”下方的数据复制到 LibreOffice Calc 中,您将更好地理解我的意思。我就是想不通,如果有人能帮助我,我将不胜感激。谢谢

这是linkhttps://regex101.com/r/m3yySN/2/

^

(?<frequency>[0-9]+) \W+
(?<word>\pL+\W?) \h+
(?<gender> [\pL()]+ (?:, \h* [\pL()]+)* ) \h+
(?<word_en> [^•]*[^•\s]) \h* \R

• \h*
(?<sent_esp> [^–]*[^\s–] ) \s*–\s*
(?<sent_en> .* (?:\R .*)*? ) \h* \R

(?<num1> [0-9]+) \h* \| \h*
(?<num2> .*\S)

\t\t\t\t\t\t

这个有点毛毛的,不过毕竟是微调而已:

^
(?<frequency>[0-9]+) \W+
(?<word>\pL+(?:,\h\pL+|\W)*) \h+
(?<gender> [\pL()]+ (?:, \h* [\pL()]+)* ) \h+
(?<word_en> [^•]*[^•\s]) \h* \R
• \h*
(?<sent_esp> [^–]*[^\s–] ) \s*–\s*
(?<sent_en> .* (?:\R .*)*? ) \h* \R
(?<num1> [0-9]+) \h* \| \h*
(?<num2> .*\S)

Results现在看起来不错