We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 823bbbd + 453ccdc commit d2125abCopy full SHA for d2125ab
1 file changed
src/components/data-entry/MaterialsInput/utils.tsx
@@ -334,15 +334,7 @@ export const validateSmiles = (value: string): string | null => {
334
* @returns Validated id string or null
335
*/
336
export const validateMPID = (value: string): string | null => {
337
- if (
338
- value.match(/mp\-\d/) !== null ||
339
- value.match(/mvc\-\d/) !== null ||
340
- value.match(/mol\-\d/) !== null
341
- ) {
342
- return value;
343
- } else {
344
- return null;
345
- }
+ return /^mp-([a-zA-Z]+|\d+)$/.test(value) || /^(mvc|mol)-\d+$/.test(value) ? value : null;
346
};
347
348
/**
0 commit comments