- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想记录演讲者的姓名和发表的评论。我已经尝试使用 ([-]{5,}\s\S+)
的几种不同变体,但这似乎并没有解决问题。理想情况下,我希望得到以下结果:
var data = [
{
name: "Operator",
comment: "Ladies and gentlemen, thank you for standing by. Welcome to the 3M First Quarter Earnings Conference Call. (Operator Instructions) As a reminder, this conference is being recorded, Thursday, April 25, 2019. I would now like to turn the call over to Bruce Jermeland, Vice President of Investor Relations at 3M."
},
{
name: "Bruce Jermeland, 3M Company - Director of IR",
comment: "Thank you, and good morning, everyone. Welcome to our first quarter 2019 business review. With me today are Mike Roman, 3M's Chief Executive Officer; and Nick Gangestad, our Chief Financial Officer. Mike and Nick will make some formal comments, and then we'll take your questions. Please note that today's earnings release and slide presentation accompanying this call are posted on our Investor Relations website at 3m.com under the heading, Quarterly Earnings. Please turn to Slide 2. Before we begin, let me remind you to mark your calendars for our upcoming earnings calls on July 25 and October 24. Please take a moment to read the forward-looking statement on Slide 3. During today's conference call, we will make certain predictive statements that reflect our current views about 3M's future performance and financial results. These statements are based on certain assumptions and expectations of future events that are subject to risks and uncertainties. Item 1A of our most recent Form 10-K lists some of the most important risk factors that could cause actual results to differ from our predictions. Finally, please note that throughout today's presentation, we will be making references to certain non-GAAP financial measures, in particular, measures which exclude the impact of the Tax Cuts and Jobs Act and significant litigation-related charges. Reconciliations of the non-GAAP measures can be found in the appendix of today's presentation and press release. Please turn to Slide 4, and I'll hand it off to Mike. Mike?"
},
...
]
我怎样才能做到这一点?
var text = `Q1 2019 3M Co Earnings Call
ST. PAUL Apr 27, 2019 (Thomson StreetEvents) -- Edited Transcript of 3M Co earnings conference call or presentation Thursday, April 25, 2019 at 1:00:00pm GMT
TEXT version of Transcript
================================================================================
Corporate Participants
================================================================================
* Bruce Jermeland
3M Company - Director of IR
* Michael F. Roman
3M Company - CEO & Director
* Nicholas C. Gangestad
3M Company - Senior VP & CFO
================================================================================
Conference Call Participants
================================================================================
* Andrew Alec Kaplowitz
Citigroup Inc, Research Division - MD and U.S. Industrial Sector Head
* Andrew Burris Obin
BofA Merrill Lynch, Research Division - MD
* Charles Stephen Tusa
JP Morgan Chase & Co, Research Division - MD
* Deane Michael Dray
RBC Capital Markets, LLC, Research Division - Analyst
* John Fred Walsh
Crédit Suisse AG, Research Division - Director
* John George Inch
Gordon Haskett Research Advisors - MD & Senior Analyst of Multi-Industrials
* Joseph Alfred Ritchie
Goldman Sachs Group Inc., Research Division - VP & Lead Multi-Industry Analyst
* Joshua Charles Pokrzywinski
Morgan Stanley, Research Division - Equity Analyst
* Julian C.H. Mitchell
Barclays Bank PLC, Research Division - Research Analyst
* Laurence Alexander
Jefferies LLC, Research Division - VP & Equity Research Analyst
* Nigel Edward Coe
Wolfe Research, LLC - MD & Senior Research Analyst
* Scott Reed Davis
Melius Research LLC - Founding Partner, Chairman, CEO & Research Analyst of Multi-Industry Research
================================================================================
Presentation
--------------------------------------------------------------------------------
Operator [1]
--------------------------------------------------------------------------------
Ladies and gentlemen, thank you for standing by. Welcome to the 3M First Quarter Earnings Conference Call. (Operator Instructions) As a reminder, this conference is being recorded, Thursday, April 25, 2019.
I would now like to turn the call over to Bruce Jermeland, Vice President of Investor Relations at 3M.
--------------------------------------------------------------------------------
Bruce Jermeland, 3M Company - Director of IR [2]
--------------------------------------------------------------------------------
Thank you, and good morning, everyone. Welcome to our first quarter 2019 business review. With me today are Mike Roman, 3M's Chief Executive Officer; and Nick Gangestad, our Chief Financial Officer. Mike and Nick will make some formal comments, and then we'll take your questions.
Please note that today's earnings release and slide presentation accompanying this call are posted on our Investor Relations website at 3m.com under the heading, Quarterly Earnings. Please turn to Slide 2.
Before we begin, let me remind you to mark your calendars for our upcoming earnings calls on July 25 and October 24. Please take a moment to read the forward-looking statement on Slide 3.
During today's conference call, we will make certain predictive statements that reflect our current views about 3M's future performance and financial results. These statements are based on certain assumptions and expectations of future events that are subject to risks and uncertainties. Item 1A of our most recent Form 10-K lists some of the most important risk factors that could cause actual results to differ from our predictions.
Finally, please note that throughout today's presentation, we will be making references to certain non-GAAP financial measures, in particular, measures which exclude the impact of the Tax Cuts and Jobs Act and significant litigation-related charges. Reconciliations of the non-GAAP measures can be found in the appendix of today's presentation and press release.
Please turn to Slide 4, and I'll hand it off to Mike. Mike?
--------------------------------------------------------------------------------
Operator [87]
--------------------------------------------------------------------------------
Ladies and gentlemen, that does conclude the conference call for today. We thank you for your participation and ask that you please disconnect your lines.`;
console.log(text);
最佳答案
您可以使用捕获组,并为说话者的匹配使用字符类,并指定名称中允许使用的字符,并在中间用空格重复该字符。
然后匹配仅包含连字符的行,然后使用匹配以下内容的第二个捕获组,直到遇到以连字符开头的下一行。 (或者多个,如果你想让它更具体。
^[ \t]*(\w+(?:[ \t]+[\w,-]+)*)[\t ]+\[\d+\]\r?\n-+\s+((?:(?:\r?\n)?(?!-).*)*)
解释
^
字符串开始[\t]*
匹配 0+ 个制表符/空格(
捕获组 1
\w+(?:[\t]+[\w,-]+)*
匹配 1+ 个单词 char 并重复 0+ 次匹配 1+ 个制表符/空格和一个字符类,其中您可以指定允许匹配的内容。)
关闭第 1 组[\t ]+\[\d+\]
匹配1+个制表符/空格,[
..]之间的1+个数字
>\r?\n-+\s+
匹配换行符,1+ 次连字符后跟 1+ 次空白字符(这也将匹配注释开始前的前置空格) (
捕获组 2
(?:
非捕获组
(?:\r?\n)?(?!-).*
匹配可选的换行符,断言右边的不是连字符,然后匹配该行的其余部分。 )*
关闭非捕获组并重复0+次)
关闭组 2var str = `Q1 2019 3M Co Earnings Call
ST. PAUL Apr 27, 2019 (Thomson StreetEvents) -- Edited Transcript of 3M Co earnings conference call or presentation Thursday, April 25, 2019 at 1:00:00pm GMT
TEXT version of Transcript
================================================================================
Corporate Participants
================================================================================
* Bruce Jermeland
3M Company - Director of IR
* Michael F. Roman
3M Company - CEO & Director
* Nicholas C. Gangestad
3M Company - Senior VP & CFO
================================================================================
Conference Call Participants
================================================================================
* Andrew Alec Kaplowitz
Citigroup Inc, Research Division - MD and U.S. Industrial Sector Head
* Andrew Burris Obin
BofA Merrill Lynch, Research Division - MD
* Charles Stephen Tusa
JP Morgan Chase & Co, Research Division - MD
* Deane Michael Dray
RBC Capital Markets, LLC, Research Division - Analyst
* John Fred Walsh
Crédit Suisse AG, Research Division - Director
* John George Inch
Gordon Haskett Research Advisors - MD & Senior Analyst of Multi-Industrials
* Joseph Alfred Ritchie
Goldman Sachs Group Inc., Research Division - VP & Lead Multi-Industry Analyst
* Joshua Charles Pokrzywinski
Morgan Stanley, Research Division - Equity Analyst
* Julian C.H. Mitchell
Barclays Bank PLC, Research Division - Research Analyst
* Laurence Alexander
Jefferies LLC, Research Division - VP & Equity Research Analyst
* Nigel Edward Coe
Wolfe Research, LLC - MD & Senior Research Analyst
* Scott Reed Davis
Melius Research LLC - Founding Partner, Chairman, CEO & Research Analyst of Multi-Industry Research
================================================================================
Presentation
--------------------------------------------------------------------------------
Operator [1]
--------------------------------------------------------------------------------
Ladies and gentlemen, thank you for standing by. Welcome to the 3M First Quarter Earnings Conference Call. (Operator Instructions) As a reminder, this conference is being recorded, Thursday, April 25, 2019.
I would now like to turn the call over to Bruce Jermeland, Vice President of Investor Relations at 3M.
--------------------------------------------------------------------------------
Bruce Jermeland, 3M Company - Director of IR [2]
--------------------------------------------------------------------------------
Thank you, and good morning, everyone. Welcome to our first quarter 2019 business review. With me today are Mike Roman, 3M's Chief Executive Officer; and Nick Gangestad, our Chief Financial Officer. Mike and Nick will make some formal comments, and then we'll take your questions.
Please note that today's earnings release and slide presentation accompanying this call are posted on our Investor Relations website at 3m.com under the heading, Quarterly Earnings. Please turn to Slide 2.
Before we begin, let me remind you to mark your calendars for our upcoming earnings calls on July 25 and October 24. Please take a moment to read the forward-looking statement on Slide 3.
During today's conference call, we will make certain predictive statements that reflect our current views about 3M's future performance and financial results. These statements are based on certain assumptions and expectations of future events that are subject to risks and uncertainties. Item 1A of our most recent Form 10-K lists some of the most important risk factors that could cause actual results to differ from our predictions.
Finally, please note that throughout today's presentation, we will be making references to certain non-GAAP financial measures, in particular, measures which exclude the impact of the Tax Cuts and Jobs Act and significant litigation-related charges. Reconciliations of the non-GAAP measures can be found in the appendix of today's presentation and press release.
Please turn to Slide 4, and I'll hand it off to Mike. Mike?
--------------------------------------------------------------------------------
Operator [87]
--------------------------------------------------------------------------------
Ladies and gentlemen, that does conclude the conference call for today. We thank you for your participation and ask that you please disconnect your lines.`;
var m;
var data = [];
var regex = /^[ \t]*(\w+(?:[ \t]+[\w,-]+)*)[\t ]+\[\d+\]\r?\n-+\s+((?:(?:\r?\n)?(?!-).*)*)/mg;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
data.push({
"name": m[1],
"comment": m[2]
});
}
console.log(data);
关于javascript - 使用正则表达式捕获演讲者姓名和评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57256571/
我正在使用评论系统,现在,我想重写 url 评论的片段并附加一个符号#,我想将页面部分移动到评论列表,正好是最后一个评论用户,带有 username 我在发表评论时使用 next 重定向用户: {
这个问题在这里已经有了答案: "Rate This App"-link in Google Play store app on the phone (21 个回答) 关闭2年前。 有没有一种方法可以要
长期潜伏者第一次海报... 我们正在使用 Facebook 的 API 将其集成到我们的网络应用程序中,并且我们能够通过 {page-id}/ratings 部分中的 {open_graph_stor
我正在尝试让 Visual Studio 2012 自动格式化我的评论 block ,就像它对我的 C# block 所做的那样。我希望我的评论看起来像这样: /* * Here is my C#
在 MySQl 中创建表时对每个字段进行注释是否会影响性能?我正在处理一个包含 1000 多个表的数据库,几乎每个表中的每个字段都有注释。我只是想知道这是否会以任何方式影响 MySQL 的性能? 最佳
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
这个问题在这里已经有了答案: SQL select only rows with max value on a column [duplicate] (27 个答案) 关闭 5 年前。 我这里有 2
如何在评论中正确编写 --> 或 -->? 我正在维护一个包含许多小程序代码条目的大型 html 文件。说: a --> b. 我在 HTML 中将其编码为 -->: a --> b. 但是,我
这是一个简单的问题。有没有办法允许用户直接在我的应用程序中输入评论和/或评级,并将这些数据发回 Android Market?如果是这样,如果我使用 EditText View 允许用户输入,代码会是
注释是否表示代码中带有//或/* */的注释? 最佳答案 不,注释不是评论。使用语法 @Annotation 将注释添加到字段、类或方法。最著名的注解之一是@Override,用于表示方法正在覆盖父类
我有一个包含两个模型的 Django 应用程序:第一个是 django.contrib.auth.User,第二个是我创建的 Product。 我会为每个产品添加评论,因此每个注册用户都可以为每个产品
有没有办法评论多行......其中已经有一些评论? 即 ... Hello world! Multi-line comment end --> 看来连
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: obj.nil? vs. obj == nil 现在通过 ruby koans 工作,发现这个评论嵌入在
这是一个基本问题 .gemrc 文件中是否允许注释? 如果是,你会怎么做? 我这里查了没用 docs.rubygems.org/read/chapter/11 最佳答案 文档说:The config
有没有办法在 SASS 中添加 sass-only 注释?你知道,所以输出 .css 文件没有那些注释 例如, /* global variables */ $mainColor: #666; /*
我想搜索在任何媒体上发布的评论中的任何特定关键字或几个关键字的组合。我的要求是在 API 的帮助下获取包含该关键字的评论。我浏览了 Instagram API 的文档,发现只能通过哈希标签进行搜索,而
在 WordPress 中,您可以在页面加载之前执行以下操作来编辑文章的内容: add_filter('the_content', 'edit_content'); function edit_con
在指示要合并的内容时, checkin 合并的最佳方法是什么?我已经说过 10 个变更集我正在从我的主分支合并到一个发布分支。每一个都包含我在 checkin 主分支时写的详细注释。现在,当我合并时,
我知道如何查询常规网站的社交参与度计数。可以使用Facebook图形浏览器(https://developers.facebook.com/tools/explorer/)或throug api轻松实
我正在尝试从 YouTube 视频中获得特定评论。例如,我想从 YouTube 视频的第 34 条评论中获取详细信息。有谁知道在不阅读所有评论列表的情况下我该怎么做? 或者,如果没有任何解决方案可以仅
我是一名优秀的程序员,十分优秀!