[英]Split string on certain words case insensitive using regex (alteryx)
如果我的字符串是:
mary lamb The beast the castle THE large lake
我想生產:
mary lamb
The beast
the castle
The large lake
如果我這樣做(?i)(?:(.*the))
那么它只會在最后一個拆分,但我想在每個“the”上拆分,不管大小寫。
你需要使用
(?i)(?=\bthe\b)
(?i)\s+(?=\bthe\b)
請參閱正則表達式演示。 詳情:
(?i)
- 不區分大小寫的修飾符\s+
- 一個或多個空格(?=\bthe\b)
- 與緊跟the
整個單詞后面的位置匹配的正向前瞻。正則表達式的替代方案:
做一個公式用CHR(13)+"the"
替換"the"
the”
做一個更簡單的文本到列,使用\n
作為分隔符並拆分為行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.