Commit 9fc5653a authored by An Nguyen's avatar An Nguyen
Browse files

Add new format for ",3 H" -> ", 3H"

parent c31ead60
......@@ -47,6 +47,22 @@ const formatChemicalFormular = (formular) => {
const sampleAnalysesFormatPattern = {
_13cnmr: [
{
pattern: '(,{0,1}) (\\d+\\.){0,1}(\\d*) {0,1}H(,|\\))',
replace: {
ops: [
{ insert: '#{1}#{2}#{3}H#{4}' },
],
},
},
{
pattern: '(,{0,1})(\\d+\\.){0,1}(\\d*) {0,1}H(,|\\))',
replace: {
ops: [
{ insert: '#{1} #{2}#{3}H#{4}' },
],
},
},
{
pattern: '13C NMR',
replace: {
......@@ -143,6 +159,22 @@ const sampleAnalysesFormatPattern = {
},
],
_1hnmr: [
{
pattern: '(,{0,1}) (\\d+\\.){0,1}(\\d*) {0,1}H(,|\\))',
replace: {
ops: [
{ insert: '#{1}#{2}#{3}H#{4}' },
],
},
},
{
pattern: '(,{0,1})(\\d+\\.){0,1}(\\d*) {0,1}H(,|\\))',
replace: {
ops: [
{ insert: '#{1} #{2}#{3}H#{4}' },
],
},
},
{
pattern: '1H NMR',
replace: {
......
......@@ -30,7 +30,7 @@ const mapValueToGroupRegex = (content, matchedGroup) => {
const patt = `#{${idx + 1}}`;
const insertString = d.insert;
const dd = { ...d };
dd.insert = insertString.replace(patt, m);
dd.insert = insertString.replace(patt, m || '');
return dd;
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment