samedi 18 octobre 2014

How to replace words starts with certain character and ends with certain character


Vote count:

0




Assume that i have the following line



update tblBattleInfo set BattleResultUser_1=@ResultUser_1+BattleResultUser_1,BattleResultUser_2=@ResultUser_2+BattleResultUser_2 where BattleInfoId=@BattleInfoId


What i want is i want to replace all words that starts with @ character and end with the any character other than (a,z,A,Z)


As replacement i want '55' to be used


With this basically i will parse SQL queries to analyze at database tuning advisor


How can i achieve it ?


So the above sentence would become



update tblBattleInfo set BattleResultUser_1='55'+BattleResultUser_1,BattleResultUser_2='55'+BattleResultUser_2 where BattleInfoId='55'


c# .net 4.5 regex wpf


I want to use regex for this job as i suppose that would be best option



asked 1 min ago







How to replace words starts with certain character and ends with certain character

Aucun commentaire:

Enregistrer un commentaire