Remove text except for a later exception before a certain character,

我的梦境 提交于 2020-01-06 06:30:08

问题


So i have this list of items, and i need to filter out certain parts cause of the output used by a program. Example : Start (what it looks like currently) :

word1:word2:word3

all "words" have different sizes in text. i need it to look like :

word2:word3

Thanks in advance for any answers. (first answer did not work)


回答1:


Use replace with regular expression:

^[^:]*:\s*

This will match anything before first colon, including colon, and any potential space (if none also ok) after the first colon. Replace that with empty string.



来源:https://stackoverflow.com/questions/45994016/remove-text-except-for-a-later-exception-before-a-certain-character

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!