Domanda

I am looking to replace ([a-zA-Z0-9])/(/) to [$1]
e.g InductionFinal() to [InductionFinal]
in VS 2010 search and replace regex.

regexes {[a-zA-Z0-9]+}{\(\)} and ([a-zA-Z0-9]+)(/(/)) to [\0] results in

<span data-bind="text: [PatientGender()]"></span>

How do I get rid of ()?

È stato utile?

Soluzione

Bingo:

in Visual Studio 2010 to replace <span data-bind="text: PatientGender()"></span> to <span data-bind="text: [PatientGender]"></span>

in search field enter {[a-zA-Z0-9]+}{\(\)} and in replace [\1]

Altri suggerimenti

Use +

([a-zA-Z0-9]+)\(\)

and replace it with :

[$1]

+ operator matches one or more of the previous token.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top