An invalid regex pattern

后端 未结 5 2078
灰色年华
灰色年华 2021-02-07 01:52

I have a piece of code in c# that checks, if a value is a valid regex pattern.

Code is straight forward:

   try
   {
      System.Text.RegularExpressions.R         


        
5条回答
  •  爱一瞬间的悲伤
    2021-02-07 02:16

    Try this:

    *
    

    BTW, in Java there is a method to compile a string to a pattern and it throws an exception with precise error diagnostic.

提交回复
热议问题