let regExp = /\{([^}]+)\}/;
let matches = regExp.exec('Now show {this}, and not (that).');
console.log(matches[1]);
let regExp = /\{([^}]+)\}/;
let matches = regExp.exec('Now show {this}, and not (that).');
console.log(matches[1]);
let regExp = /\(([^)]+)\)/;
let matches = regExp.exec('Show (this) and not (that).');
console.log(matches[1]);
sudo rm –R /path/to/file/or/folder
l = [1,2,3,4,4,5,5,5,6,1,6]
duplicates = list(set([
x for x in l
if
l.count(x) > 1
and (
x == max(l)
or x == min(l)
)
]))
for d in duplicates:
l.remove(d)
print(l)
l = [1,2,3,4,4,5,5,5,6,1,6]
duplicates = list(set(
[
x
for x in l
if l.count(x) > 1
and x == max(l)
]
))
for d in duplicates:
l.remove(d)
print(l)
l = [1,2,3,4,4,5,5,5,6,1]
duplicates = list(set([x for x in l if l.count(x) > 1]))
for d in duplicates:
l.remove(d)
print(l)