开发者

Regex to remove (ISBN 88987321) from the string

开发者 https://www.devze.com 2023-04-03 20:24 出处:网络
What is the regex to remove (ISBN 8987983721) from the string, including ( a开发者_运维百科nd ) characters.

What is the regex to remove (ISBN 8987983721) from the string, including ( a开发者_运维百科nd ) characters. I'm trying to do it with Bilk Rename Utility but can not succeed.

I provided (ISBN [0-9]*)() and \1\2 but insted everything is removed from the string except ISBN but I need the opposite effect


Javascript:

string = string.replace(/\(ISBN [^)]+\)/g, '')

PHP:

$string = preg_replace('/\(ISBN [^)]+\)/', '', $string);

sed:

string=$(sed 's/(ISBN [^)]\+)//g' <<< "$string")

Ruby:

string = string.gsub(/\(ISBN [^)]+\)/, '')


if you want to remove the ( and ):

(\(ISBN [0-9]*)\)

will give you the result with this test string:

Im testing to remove (ISBN 8987983721) from my string // Im testing to remove from my string

and depending on language you may want to use global replace so you remove all (ISBN xxxxx) texts

0

精彩评论

暂无评论...
验证码 换一张
取 消