这是我的输入文件。
var t = 3;
var tout =1000;
var site_url = 'http://182.72.85.2/djaxtesting/enterprise_dev/';var file_url = 'http://182.72.85.2/djaxtesting/enterprise_dev/';var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
var firstPlay = true;
var sz = ['5x468x60x4x9876'];
pbjs.que.push(function() {
var adUnits = [
/*header-bidding-bidders*/
{
code: '5x468x60x4x9876',
sizes:[468,60] ,
bids: [
{
bidder: 'ADKERNEL',
params: {
host : "h",
zoneId : "h",
}
},
{
bidder: 'internal',
params:{
zid :'5',
aid :'4',
rcode :'9876'
}
} ]
}];
/*header-bidding-bidders*/
我怎样才能在上面的文件中找到特定的段落。考虑为字符串。然后找到该文件中的特定代码
{
bidder: 'internal',
params:{
zid :'5',
aid :'4',
rcode :'9876'
}
但我只知道,在file.select段落的整个字符串
中的字符串下面投标人: '内部'
我想要这样的输出
{
bidder: 'internal',
params:{
zid :'5',
aid :'4',
rcode :'9876'
}
}
答案 0 :(得分:1)
答案 1 :(得分:1)
您应该使用此优化模式:t=# with i as (
insert into person (name,age,can_drive)
select 'Fred',27,true
where not exists (
select 0 from person where name = 'Fred' and age= 27 and can_drive
)
returning id
)
select * from i
union all
select id from person where name = 'Fred' and age= 27 and can_drive;
id
----
1
(1 row)
使用“否定字符类”可加快正则表达式的效率。 这种模式只需49步即可成功匹配您想要的子字符串。
以下是细分:
/\{\s*bidder:\s*'internal'[^}]*\}[^}]*\}/