Home > OS >  Linux struggles to find a directory inside the following subdirectories in a directory containing th
Linux struggles to find a directory inside the following subdirectories in a directory containing th

Time:09-16

The find/data/- regextype posix extended - regex ". * \. (TXT | SHTML) "| xargs perl - PI - e 's | ` http://[a - zA - Z0-9.] {1, 26}. (test1. Cn | | test.com.cn test3. Cn) ` | ` https://[a - zA - Z0-9.] {1, 26}. (test1. Cn | | test.com.cn test3. Cn) ` | g'
I this how to change to replace the contents of the slow to string, is allowed,
But is the regular expression, behind the content of the replacement is not correct, should how to write?

CodePudding user response:

The find/data/- regextype posix extended - regex ". * \. (TXT) "| xargs perl - PI - e" s | http://[a - zA - Z0-9.] {1, 26}. The test. The cn | | g "https://$1.test.cn


Masters, I this is what replacement,
http://11.test.cn/dfsfasfasf
http://11.test.cn/d12343
After replacing become
https://.test.cn/dfsfasfasf
https://.test.cn/d12343

The inside of the 11 gone? How to write,

CodePudding user response:

1, add parentheses, ([a - zA_Z0-9.] {1, 26})
2, I'm not sure the back reference use perl $1 or \ 1
  • Related