mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-11-05 13:43:56 +01:00
17 lines
282 B
JavaScript
17 lines
282 B
JavaScript
|
class mhchemCE{
|
||
|
static extract(string) {
|
||
|
const m = string.match(mhchemCE.regEx)
|
||
|
if (m) {
|
||
|
return m[1]
|
||
|
} else {
|
||
|
return string
|
||
|
}
|
||
|
}
|
||
|
static test(string){
|
||
|
return mhchemCE.regEx.test(string)
|
||
|
}
|
||
|
static get regEx(){
|
||
|
return /^\\ce\{(.*)\}$/
|
||
|
}
|
||
|
}
|