From 7e62f42e3e4d2e31801cdee7494294ada899fdff Mon Sep 17 00:00:00 2001 From: Valerio Arnaboldi Date: Tue, 7 Jan 2020 15:41:34 -0800 Subject: [PATCH] fix: changed regex to support genes with square brackets at the end e.g. CELE_F49C12.2 ( WBGene00009872 ) [CELE_F49C12.2] --- src/frontend/curator_dashboard/src/AFPValues.js | 2 +- src/frontend/feedback_form/src/AFPValues.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/curator_dashboard/src/AFPValues.js b/src/frontend/curator_dashboard/src/AFPValues.js index 4ee793e..7e521b0 100644 --- a/src/frontend/curator_dashboard/src/AFPValues.js +++ b/src/frontend/curator_dashboard/src/AFPValues.js @@ -87,7 +87,7 @@ export function extractEntitiesFromTfpString(entitiesString, prefix) { * @returns {string} a string containing the list of entities in AFP format, ready to be stored in the DB */ export function transformEntitiesIntoAfpString(entitiesList, prefix) { - const addInfoRegex = / \( ([^ ]+) \)$/; + const addInfoRegex = / \( ([^ ]+) \)( \[[^ ]+\])?$/; let entity; let addInfo = ""; let results = []; diff --git a/src/frontend/feedback_form/src/AFPValues.js b/src/frontend/feedback_form/src/AFPValues.js index 4ee793e..7e521b0 100644 --- a/src/frontend/feedback_form/src/AFPValues.js +++ b/src/frontend/feedback_form/src/AFPValues.js @@ -87,7 +87,7 @@ export function extractEntitiesFromTfpString(entitiesString, prefix) { * @returns {string} a string containing the list of entities in AFP format, ready to be stored in the DB */ export function transformEntitiesIntoAfpString(entitiesList, prefix) { - const addInfoRegex = / \( ([^ ]+) \)$/; + const addInfoRegex = / \( ([^ ]+) \)( \[[^ ]+\])?$/; let entity; let addInfo = ""; let results = [];