社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

python regex查找双引号中包含变量的字符串

Hoàng Quốc Anh • 5 年前 • 1662 次点击  

Python中使用ReGEX的代码,可以执行类似的操作

输入:

<script type="text/javascript">
(function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e)
 {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
window.parent.OnUploadCompleted(0,"/userfiles/abc.txt","abc.txt", "") ;</script>

对于abc.txt是一个类似于 self.filename

输出仅: /userfiles/abc.txt 没有 abc.txt

问题是 userfiles 也是一个变数。

谢谢。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/43617
 
1662 次点击  
文章 [ 2 ]  |  最新文章 5 年前