【发布时间】:2022-01-19 19:53:27
【问题描述】:
假设我有一段文字: 注意:这是我正在阅读的文件,因此实际上并没有在代码中注释掉它
" ## BATTERY LIFE: Pretty medicore at 12 hours, the Creative, iAudio, Rio, and iRiver players last longer.
CUSTOMER SERVICE[-3]## CUSTOMER SERVICE: Awful. Listen to this one, remember the battery statement I made earlier.
##If your battery dies and it's still under warranty, guess what, you're out of luck, because Apple doesn't cover the battery in the iPod warranty.
##They have the nerve to charge you $30 for a warrantied iPod.
technical service[-3]## "
我想提取方括号之前的元素,例如,在这段文字中我想:客户服务[-3]和技术服务[-3]
有什么很酷的方法可以做到这一点(使用一些正则表达式的应用程序),因为我现在很难过。
【问题讨论】:
-
方括号中提到的数字的可能值是什么?