Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

regex - How to replace a String which has escape sequence inside a File using Perl? -


how replace string inside file using perl ?

perl -pi -e 's/arun/brun/g' * 

this worked fine me

but when tried change class/students/a class1/students1/b throws error how solve problem ..i tried adding slash (\) before every (/) didn't

perl -pi -e 's/class/students/a/class1/students1/b/g' * 

you using / regex delimiter.
there / in pattern , replacement. need somehow ensure these / should not treated delimiter.

you have 2 options:

  1. escape / in pattern , replacement as:

    perl -pi -e 's/class\/students\/a/class1\/students1\/b/g' * 
  2. or use different delimiter:

    perl -pi -e 's#class/students/a#class1/students1/b#g' * 

method 2 preferred keeps regex short , clean.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -