![줄을 바꾸되 일부는 메모장에 보관하세요 ++](https://rvso.com/image/1539542/%EC%A4%84%EC%9D%84%20%EB%B0%94%EA%BE%B8%EB%90%98%20%EC%9D%BC%EB%B6%80%EB%8A%94%20%EB%A9%94%EB%AA%A8%EC%9E%A5%EC%97%90%20%EB%B3%B4%EA%B4%80%ED%95%98%EC%84%B8%EC%9A%94%20%2B%2B.png)
Notepad++를 사용하여 많은 양의 코드를 찾거나 바꾸고 싶습니다.
나는 다음을 많이 가지고 있습니다:
각도[]={6.2744589,5.4066987,1.4066987};
3가지 값으로. 첫 번째와 두 번째 값을 모두 0으로 설정하고 세 번째 위치에 값을 유지해야 합니다. S
각도[]={6.2744589,5.4066987,1.4066987};
에게
각도[]={0,0,1.4066987};
감사해요!
답변1
답변2
- Ctrl+H
- 무엇을 찾다:
\bangles\[\]=\{\K[^,]+,[^,]+
- 다음으로 교체:
0,0
- Replace all
설명:
\b : word boundary, to be sure to match angles but not somethingangles
angles : literally angles
\[\]=\{ : literally []=, brackets have to be escaped as they have special meaning in regex
\K : Forget all we have seen until this point
[^,]+ : 1 or more any character that is not a comma, that matches also negative values
, : a comma
[^,]+ : 1 or more any character that is not a comma
- 정규식 확인
- 확인하지 마세요
. matches newline
주어진 예에 대한 결과:
angles[]={0,0,1.4066987};