小编Mug*_*dha的帖子

How to remove square brackets in string using regex?

['abc','xyz'] – this string I want turn into abc,xyz using regex in javascript. I want to replace both open close square bracket & single quote with empty string ie "".

javascript regex

35
推荐指数
3
解决办法
8万
查看次数

Django过滤器与正则表达式

我想为django的模型的charField写正则表达式.该正则表达式包含所有字母,最后一个字符包含"/".

例如:"序列/"

我返回正则表达式如下,

Model.objects.filter(location_path__iregex=r'^[a-zA-Z]/$')
Run Code Online (Sandbox Code Playgroud)

它没有显示过滤数据.location_path的演示数据是['sequences /','abc/xyz /','abc/aaaa/aaa','pqr /']

我想过滤'sequence /','pqr /'这样的数据,其中包含来自az和字段末尾的任何字符'/'

请给我正确的正则表达式模式和语法

python regex django

18
推荐指数
1
解决办法
2万
查看次数

标签 统计

regex ×2

django ×1

javascript ×1

python ×1