The project needs to replace emoji with pictures in the text information obtained from the server, but the format returned by the server is similar to this
eg:[pig_4] [pig_5] [pig_4] [pig_5] [ pig_5], how should I replace the corresponding [pig_4] with the corresponding picture? Use interception? ?
You can use regular expressions to implement the analysis yourself
Or see if there is an emoji library, https://github.com/search?l=J...
Then make it filter(ng1)/pipe(ng2)
It’s hard to judge, emoji strings basically all start with /, and some special characters also start with /, so if you can accurately distinguish whether they are special characters, you can judge. Regex is very simple to write!