방법 파일에서 얻을 수있는 같은 라인에 라인의 서브 텍스트 :앞에 추가
This is a line 2 There is 1 line imagine 3 lines two times two is 4 There is no number here
다음 :
2, This is a line 2 1, There is 1 line 3, imagine 3 lines 4, two times two is 4
그래서, 접두사가 라인에서 검색되며 라인마다 다를 수 있습니다. bash와 perl에서이 작업을 수행하는 방법은 무엇입니까? 대략적으로 같은
s/\d+/$&, $`$&$'/
는 [펄 정규식 튜토리얼]를 살펴 보자 (http://perldoc.perl.org/perlretut.html) 당신은 할 수 있어야 그것을 해결하십시오. –