I want to replace the following 3 lines:
this.CSType = typeof(DateTimeOffset?);
this.CSTypeString = "Target";
this.MappedCSType = SQLTypes.MappedCSType.NullableDateTimeOffset;
With this:
result = "Target";
So I try to use this regex:
Find: :bthis.CSType = typeof(*);\n:bthis.CSTypeString = "{[^"]+}";\n:bthis.MappedCSType = SQLTypes.MappedCSType.*;
Replace: result = "\1";
But there is an error: Grouped expression is missing ')'.
Is there any fault in my expression? what is your suggestion?
I think the problem with your regex is that you do not have group defined. I suppose you tried to define group by using pair of
{[^"]+}which is not syntactically correct. Groups are defined using round brackets(). Alsotypeof(*)will not matchtypeof(DateTimeOffset?).You can try following xpath
Notice pair of round brackets
([^"]+). This group i.e group 1 will matchTargetstring. You can validate this xpath at http://regexpal.comHope this helps