Regex 正则表达式匹配撇号

Regex 正则表达式匹配撇号,regex,Regex,我有以下文件: 该文件中的每一行都以一个apotrophe作为分隔符结束。我需要一个正则表达式来匹配IMD+F++:::和分隔符(')之间的每个撇号 我有下面的正则表达式来匹配IMD+F++:::和下面的分隔符之间的所有文本,但是我需要一个只获取多余撇号的正则表达式 (?<=IMD\+F\+\+:::)(.*?)(?='\n) (?以下.NET中的正则表达式: (?<=IMD\+F\+\+:::.*)'(?!\r?\n) (?使用什么正则表达式风格(即什么语言)?你想替换撇号?获

我有以下文件:

该文件中的每一行都以一个apotrophe作为分隔符结束。我需要一个正则表达式来匹配IMD+F++:::和分隔符(')之间的每个撇号

我有下面的正则表达式来匹配IMD+F++:::和下面的分隔符之间的所有文本,但是我需要一个只获取多余撇号的正则表达式

(?<=IMD\+F\+\+:::)(.*?)(?='\n)

(?以下.NET中的正则表达式:

(?<=IMD\+F\+\+:::.*)'(?!\r?\n)

(?使用什么正则表达式风格(即什么语言)?你想替换撇号?获取是什么意思?不确定我将在其中使用的软件更喜欢什么风格的正则表达式。替换有点不精确,我的意思是在IMD+F++:::和最后一个之间匹配撇号。如果你希望在一个字符串中有多个匹配,你必须知道你最终将使用什么正则表达式beca使用每种口味实现这一点是不同的。
Regex regexObj = new Regex(@"(?<=IMD\+F\+\+:::.*)'(?!\r\n)");
    Match matchResults = regexObj.Match(subjectString);
    while (matchResults.Success) {
        // matched text: matchResults.Value
        // match start: matchResults.Index
        // match length: matchResults.Length
        matchResults = matchResults.NextMatch();
    } 
    "
(?<=      # Assert that the regex below can be matched, with the match ending at this position (positive lookbehind)
   IMD       # Match the characters “IMD” literally
   \+        # Match the character “+” literally
   F         # Match the character “F” literally
   \+        # Match the character “+” literally
   \+        # Match the character “+” literally
   :::       # Match the characters “:::” literally
   .         # Match any single character that is not a line break character
      *         # Between zero and unlimited times, as many times as possible, giving back as needed (greedy)
)
'         # Match the character “'” literally
(?!       # Assert that it is impossible to match the regex below starting at this position (negative lookahead)
   \r        # Match a carriage return character
      ?         # Between zero and one times, as many times as possible, giving back as needed (greedy)
   \n        # Match a line feed character
)
"