amber icon indicating copy to clipboard operation
amber copied to clipboard

Regex issues

Open No3371 opened this issue 4 years ago • 1 comments

Example

    1.  「ことの葉は強 (こは) く見ゆれどすまひ草露には―・つるものにざりける」〈[源順集](https://dictionary.goo.ne.jp/word/person/%E6%BA%90%E9%A0%86/#jn-212920)〉

Issues

  1. ^ 1. 「(.+)\n(?! 2.) expected to work but failed to match, does amber support Negative Look Ahead?
  2. ^ 1. 「(.+)\n matching works but replacing does not, it failed to capture. >「$1 replacement result:

    Expected: 1. 「ことの葉は強 (こは) く見ゆれどすまひ草露には―・つるものにざりける」〈[源順集](https://dictionary.goo.ne.jp/word/person/%E6%BA%90%E9%A0%86/#jn-212920)〉 Returned: > 1. 「

  3. As other have reported, amber does not support \n in replacement string.

No3371 avatar Apr 05 '21 07:04 No3371

As far as Negative Look Ahead, it looks like rust regex chooses to not have look aheads because of unpredictable performance.

  • https://github.com/rust-lang/regex/issues/127

danopia avatar Jun 01 '23 07:06 danopia