Answer the question
In order to leave comments, you need to log in
How to get substring using regular expression?
Hello. I'm trying to process the response string from the VKontakte server. Getting records from the wall. How can you process user mentions in it? The whole entry looks like this: "gewgweg ewwegoih #ihogewig #oihgeirgih [durov|iojfeirjfwe]". From [ to ] mention. What I need to do is to replace the substring from [ to ] with "everything inside after |" (vk.com/everything up to |" (without quotes). How can I do this? Now I'm doing this, the in = in.replaceAll("\\[(.*?)\\]", "упоминание");
mention is replaced. But this is not quite what I need.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question