cost 332 ms
如何在 Teradata 中使用 regexp_instr 使得搜索开始的 position 结束? 与 INSTR 不同,它不将 -1 作为 position 参数 - How to use regexp_instr in Teradata such that start position of the search start at the end? Unlike INSTR its not taking -1 as position argument

如何在 Teradata 中使用 regexp_instr 使得搜索开始的 position 结束? 与 INSTR 不同,它不将 -1 作为 position 参数?我试图从字符串的末尾获取模式的出现。 与 INSTR 不同,它不将 -1 作为 position 参数。 ...

如何使用正确的正则表达式捕获组匹配多行文本? - How to match multi-line text using the right regex capture group?

我正在尝试读取 CSV 并使用正则表达式捕获组拆分每一行。 CSV 的最后一列中有换行符,我的正则表达式的第二个捕获组似乎在第一次出现该换行符时中断并且没有捕获字符串的 rest。 以下是我到目前为止所做的。 第一条记录总是以ABC-开头,所以我把它放在我的第一个捕获组中,然后是它之后的所有其他 ...

在 Regex 中,如何无限期地匹配一个字符或另一个字符,但不对最后一个字符进行分组? - In Regex, how do I match until a char or another char indefinitely but don't group the last char?

这是我的字符串,我希望我的正则表达式在第 1 组返回“bash”,在第 2 组返回“585602”(Pid 值) 我现在拥有的是 不幸的是,我看到第二个匹配组是“Pid”的 P 之前的单个换行符,第三个是 Pid 值。 我感觉到问题出在正则表达式的(.|\n)部分,但如果我删除括号,那么它会包含很 ...

设置正则表达式模式以识别枚举的重复模式,其中相同的匹配重复未知次数的连续次数 - Set a regex pattern to identify a repeating pattern of an enumeration, where the same match is repeated an unknown number of successive times

import re input_text = "hjshhshs el principal, amplio, de gran importancia, y más costoso hotel de la zona costera. Es una sobrilla roja, bastante am ...

(已解决)正则表达式选择(替换)一行中任何字符串的第三个和更多重复项 - (Resolved) Regex to select(replace) third and further duplicates of any string(s) in a single line

正则表达式旨在用于文本到语音程序,该程序难以处理包含拉伸单词或可发音的场景中断的作品,例如 AAAAAAAAARRRRRRGGHHHH,,.! 或 XXXXXXXXXXXXXXXXXX,虽然阅读不是问题,但文本到语音最终会在放弃发音后读出每个字母。 Text-To-Speech 具有支持正则表达式 ...

<div><ul><li><div>使用正则表达式 /w 抓取 RUBY</div><div id="text_translate"><p> 我想抓取网站<a href="https://www.bananatic.com/es/forum/games/" rel="nofollow noreferrer">https://www.bananatic.com/es/forum/games/</a></p><p> 并提取标签“名称”、“视图”和“回复”。 我在获取“名称”标签的非空内容时遇到了很大的问题。 你能帮助我吗? 我只需要保存有文本的元素。</p><p> 这是我的代码,我有三个变量:</p><ul><li> <strong>每个</strong>保存里面的<em><strong>回复</strong></em>。</li><li> <strong>pir</strong>保存<em><strong>视图</strong></em>中的内容</li><li> <strong>res</strong>保存<em><strong>名称中的内容。</strong></em></li></ul><p> 每个数组应该只包含它们拥有的元素。 除了<em><strong>名字</strong></em>中的东西<strong>[" "]</strong>被保存了,我希望它们不要保存在我的数组中。 <a href="https://i.stack.imgur.com/MwGEM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MwGEM.png" alt="在此处输入图像描述"></a></p><pre> require 'nokogiri' require 'open-uri' require 'pp' require 'csv' unless File.readable?('data.html') url = 'https://www.bananatic.com/de/forum/games/' data = URI.open(url).read File.open('data.html', 'wb') { |f| f << data } end data = File.read('data.html') document = Nokogiri::HTML(data) per = document.xpath('//div[@class="replies"]/text()[string-length(normalize-space(.)) > 0]').map { |node| node.to_s[/\d+/] } p per pir = document.xpath('//div[@class="views"]/text()[string-length(normalize-space(.)) > 0]').map { |node| node.to_s[/\w+/] } p pir links2 = document.css('.topics ul li div') res = links2.map do |lk| name = lk.css('.name p a').inner_text [name] end p res</pre><p> 为了修复它,我添加了一个正则表达式,但是我尝试失败了。 我只是将<strong>.inner_text</strong>替换为<strong>.to_s[/\w+/]</strong> ,但我不明白。 <a href="https://i.stack.imgur.com/gLVvS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gLVvS.png" alt="在此处输入图像描述"></a></p><p> 现在我有一个数组,其中包含 null 个值和一些我不知道它们出现在哪里的字母<em><strong>“a”</strong></em> 。</p><p> <a href="https://i.stack.imgur.com/eENmV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eENmV.png" alt="在此处输入图像描述"></a></p></div></li></ul></div> - <div><ul><li><div> SCRAPING RUBY with REGEX /w

我想抓取网站https://www.bananatic.com/es/forum/games/ 并提取标签“名称”、“视图”和“回复”。 我在获取“名称”标签的非空内容时遇到了很大的问题。 你能帮助我吗? 我只需要保存有文本的元素。 这是我的代码,我有三个变量: 每个保存里面的回复。 pir保存 ...

仅当它们位于字符串末尾之前或标点符号或 \n 之前时,才捕获捕获组中一行中的所有大写单词 - Capture all capitalized words in a row in a capture group only if they are before the end of the string or if they are before a punctuation mark or \n

import re def test_extraction_func(input_text): word = "" try_save_name = False #Not stop yet #Here I have tried to concatenate a substr ...

正则表达式重置捕获组 - Regex reset capture groups

我尝试使用“|”进行更改但似乎不可能首先解析 map 如果可能的话,如果不能,则只解析整个值,但将捕获组保持为 no 1/2,尝试使用分支重置组但也没有那样管理。 欢迎提出任何建议。 产量 output: 我还需要将值解析为内部 map 的键,它的值为 null: ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM