在Yahoo!管道,如何从item.description中提取字符串并将其复制到item.title? [英] In Yahoo! Pipes, how do I take a string from item.description and copy it to item.title?
问题描述
好的,所以我已经有了一个Pipe,使用Loop和String Regex模块从item.description中提取了所需的字符串,并使用"emit results"选项发出结果.现在,我从这里去哪里?
Okay, so I already have a Pipe where I extracted the string I need from item.description, using the Loop and String Regex modules, and am emitting the results with the "emit results" option. Now, where do I go from here?
由于已请求一个示例,因此这里是一个:
Since an example was requested, here is one:
item.title为"NBA游戏:湖人队与快船队",item.description为比赛进入加时赛.最终得分为110-90."因此,我想提取"110-90"并将其复制到标题,然后是"... Clippers(110-90)".
The item.title is "NBA Game: Lakers vs. Clippers" and the item.description is "The game went into overtime. The final score was 110-90." So the I'd like to extract "110-90" and copy it to the title, where it would then be "... Clippers (110-90)".
推荐答案
1/将分数放入"scorefield"
重命名运算符:[ item.description ] [ COPY AS ] [ scorefield ]
Rename operator: [item.description] [COPY AS] [scorefield]
Regex运算符:在[ scorefield ]中将[.* \(([[^)] +)\). *]替换为[ $ 1 ]
Regex operator : in [scorefield] replace [.*\(([^)]+)\).*] with [$1]
2/将分数添加到item.title
regex运算符:在[ item.title ]中将[($)]替换为[ $ 1 $ {scorefield} ]
Regex operator : in [item.title] replace [($)] with [$1 ${scorefield}]
Nota:
在上述各行中,除非另有说明,否则将省略外部方括号
In the above lines the outside square brackets are to be omitted unless noted otherwise
对于补语:
http://beckism.com/2009/04/yahoo_pipes/
https://brooksbayne.wordpress .com/2009/01/11/using-regular-expressions-with-yahoo-pipes/
这篇关于在Yahoo!管道,如何从item.description中提取字符串并将其复制到item.title?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!