Is it possible to recognize or extract only the chemical formula and symbols in the text, for example:
text text h2o, text text Ho3NiGe2, 20% 15°C text text text text
PS: the output will be: h20, Ho3NiGe2,
Do you want to:
Regex: \b([A-Z][a-z]{0,2}\d{0,3})+
\b([A-Z][a-z]{0,2}\d{0,3})+
Demo
Source: https://habr.com/ru/post/1685613/More articles:Replace this lambda with a method reference. (sonar.java.source is not installed. Suppose 8 or more.) - javaProguard [java.lang.IllegalArgumentException: unsigned short value overflow] - androidStrict regular expression for matching chemical formulas - regexErlang Binary Leak? - erlangTake photos in portrait mode (bokeh) in iOS 11 / iPhone 7 / 8plus in a third-party application? - iosAngular 4: Routing does not work - angularview logs of the logs of my web application on the Internet (HTMLLayout) - logbackRmarkdown: отступы элементов TOC в выводе HTML - cssadd an exception to well-known bit frameworks - bit-frameworkInability to match a simple unsigned rgb texture to a square: - openglAll Articles