在python中使用regex在字符串中查找一组路径

2024-04-28 04:19:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一根绳子,随着时间的推移可能会变大。我需要找出字符串中的工件路径。有没有一种方法可以使用regex获取所有工件的路径?我引用了他们的话。在这种情况下雷鬼会是什么样的呢?在

/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
  _warn("Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
[SSH] exit-status: 0
For pattern: *.py 10 artifacts were found
For pattern: *.md 1 artifacts were found
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/elb_ec2Connector.py
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/elb_ec2Connector_Tony.py
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/naren_weekend_stop.py
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/naren_4th_box.py
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/startontags.py
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/nitish.py
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/krishna.py
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/naren_weekend.py
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/get-pip.py
Deploying artifact: artifactory/artifactory/yum-local/test/test4/test5/startup_script.py
Deploying artifact: artifactory/artifactory/yum-local/test/test2/test3/test4/test5/test6/README.m

Deploying build info to: artifactory/artifactory/api/build
Collecting metadata...
Metadata collection done.

上面所有的东西都是字符串,我需要想办法从中得到以下部分:

^{pr2}$

请记住,路径可能会不断更改其他字符串,但初始单词部署工件将保持不变,所有路径将一起出现在日志中。。。在


Tags: to字符串pytest路径local工件using