@ SuppressWarnings ( "JavaDoc" ) public static Multiset < String > getIdentifiersFrom ( String mathml ) { Multiset < String > list = HashMultiset . create ( ) ; Pattern p = Pattern . compile ( "<((m:)?[mc][ion])(.*?)>(.{1,4}?)</\\1>" , Pattern . DOTALL ) ; Matcher m = p . matcher ( mathml ) ; while ( m . find ( ) ) { String identifier = m . group ( 4 ) ; list . add ( identifier ) ; } return list ; }
Returns a list of unique identifiers from a MathML string . This function searches for all mi - or ci - tags within the string .