Wrap text found with Regexp in Go
Jantcu
This video shows how to find a dynamic pattern using Go's regexp package, then replace the found string with a commented version of the same string. It shows how to get access to the found pattern in the ReplaceAll() method of a Regexp in Go.
We go over:
- Reading a file from the filesystem
- Creating a regular expression pattern
- Wrapping the text in a multi-line comment and replacing it in the original file
- Writing the adjust file back to the filesystem ... https://www.youtube.com/watch?v=62dl2TxGQYw
2021-01-31
500.0 LBC
Copyrighted (contact publisher)
96081563 Bytes