The custom patterns feature


I'm using ReSharper v8.1 with Visual Studio 2012

I'm using the custom patterns feature to find code similar to the following

class $ClassName$ : $Attribute$

and replace it with this.

class $ClassName$Attribute : $Attribute$

Now, here some code I want it to replace

namespace Ace.Web.Mvc.Ajax
    using System.Diagnostics.Contracts;
    using System.Reflection;
    using System.Web.Mvc;
    public class AjaxOnly : ActionMethodSelectorAttribute

I have the following settings.

$ClassName$ : ^(?:[_a-zA-Z]+\w+(?<!Attribute))$
$Attribute$ : System.Attribute

The issue I'm having is that it takes away all the <Implementation> from the code I want to replace, how can I capture it? or at least make sure it touches only the part I want which is the name of the class?

1 comment
Comment actions Permalink

Hi Eyal,

this is known issue: You are welcome to vote for it in YouTrack.
Sorry for the inconvience.


Please sign in to leave a comment.