Replacing emoticon core code with regular expressions

Copy codeThe code is as follows:
String a = “Wahaha [em: 5] aa8888 [em: 7];
String r = “\\[em:(\\d+)\\]”;
a = a.replaceAll(r, “$1.gif”);

The result is: 5. Gifaa88887. Gif

You can make the most of it.

Recommended Today

What is “hybrid cloud”?

In this paper, we define the concept of “hybrid cloud”, explain four different cloud deployment models of hybrid cloud, and deeply analyze the industrial trend of hybrid cloud through a series of data and charts. 01 introduction Hybrid cloud is a computing environment that integrates multiple platforms and data centers. Generally speaking, hybrid cloud is […]