我的平臺:Windows 7,64位; 8 GB內存;的GnuWin32; sed
4.1.5.4013; awk
3.1.6.2962。sed,awk,正則表達式來修改化學術語
我的問題:化學術語很長。
Example_1_: 4-((((2-chloroethyl)nitrosoamino)carbonyl)methylamino)cyclohexanecarboxylic acid.
Example_2_: 3'-O-(3-(N-(4-azido-2-nitrophenyl)amino)propionyl)adenosine-5'-triphosphate.
Example_3_: 2-((2-chloroethyl)methylamino)ethyl-4-ethoxybenzoate.
想要引入<wbr>
讓瀏覽器有機會打破漫長的化學術語。
想要在右巴恩後打破。
但是,如果化學術語具有3個或更多右側面,只想引入<wbr>
。
此外,如果化學術語有三個或更多個右側parens,只想爲最後兩個右側parens引入<wbr>
。原因:不想將一個字詞換成三行以上。
Example_1_ would look like this: 4-((((2-chloroethyl)nitrosoamino)carbonyl)`<wbr>`methylamino)`<wbr>`cyclohexanecarboxylic acid.
Example_2_ would look like this: 3'-O-(3-(N-(4-azido-2-nitrophenyl)amino)`<wbr>`propionyl)`<wbr>`adenosine-5'-triphosphate
Example_3_ would not be modified because it does not have 3 or more right parens.
如何使用sed
,awk
,regex
實施以上?
在此先感謝您的建議。
tks用於格式更改 –