如何使用正则表达式选择此测试? [英] how to select this test using regex?

查看:132
本文介绍了如何使用正则表达式选择此测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

word文件包含以下文字:



第6章:使其工作



那么我们如何使用前面章节中描述的原理,技术和工具在IVF实验室中建立质量管理和/或风险管理系统?正如我们已经说过的,实际上这些目标不能仅限于IVF实验室,它们必须涉及整个IVF中心,其所有操作及其所有人员。但是,出于本书的目的,我们可以考虑与实验室相关的一些特定领域,这些领域将说明它们对于正确的实验室管理是如何固有的。



A因此,推论是,只要科学家遵循SOP,他们就应该对任何不良事件进行赔偿(另见第6章:保护IVF实验室工作人员免受不公平诉讼)。即使由于SOP中定义的过程中的疏忽而导致问题发生,责任也最终由签署SOP的主要医师负责,因为通过签署SOP他们同意将其用于治疗他们的病人。







我使用正则表达式

word file contain following text:

Chapter 6: MAKING IT WORK

So how do we go about using the principles, techniques and tools described in the preceding chapters to set up quality management and/or risk management systems in an IVF lab? As we have already said, in truth these goals cannot be limited to the IVF lab, they must involve the entire IVF Centre, all its operations and all its personnel. However, for the purposes of this book, we can consider some specific areas that are pertinent to the lab that will illustrate how they are inherent to proper lab management.

A corollary of this is, therefore, that so long as the scientists follow the SOPs they ought to be indemnified against any adverse events (see also Chapter 6: "Protecting IVF Laboratory Staff From Unfair Litigation"). Even if a problem were to occur as a result of an oversight in a process defined in an SOP, the responsibility ultimately rests with the lead physician who signed off on the SOP, because by signing the SOP they agreed that it would be used in the treatment of their patients.



I use the regex

@"Chapter\s+(\d+)\:\s([^\n]+)"





但它选择了粗体内容



我想要拳头粗体内容。第一个粗体内容是文档的第一行如何为此写入REGEX

推荐答案

试试这个:

Try this:
public static Regex regex = new Regex(
    "^Chapter\\s+(\\d+)\\:\\s([^\\n]+)",
    RegexOptions.Multiline
    | RegexOptions.Singleline
    | RegexOptions.CultureInvariant
    | RegexOptions.Compiled
    );



没有保证,但是当我运行它时它似乎有效Expresso。



顺便说一句:如果你想玩regerexs,那就得到一份 Expresso [ ^ ] - 它是免费的,它检查和生成正则表达式。我经常使用它!


No guarantees, but it seems to work when I run it through Expresso.

BTW: If you want to play with regerexs, then get a copy of Expresso [^] - it's free, and it examines and generates Regular expressions. I use it a lot!


这篇关于如何使用正则表达式选择此测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆