我想从Linux中的字符串中提取特定的字符串。如何从linux中的字符串获取子字符串?
例如,我想从下面的字符串中提取 'android.content.pm.PackageParser.parseBaseApplication'。
该字符串具有常规格式,只有括号内的字符串是可更改的。
Join point 'method-execution(boolean android.content.pm.PackageParser.parseBaseApplication(android.content.pm.PackageParser$Package, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, int, java.lang.String[]))' in Type
但是,我很难找到一个合适的方法来做到这一点。
起初,我试过sed命令,但它太复杂了,所以我无法完成这项工作。
你能推荐其他方法吗?
非常感谢。