From 755093a25949fe481e117a139465b3c5cc09aecc Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 23 Jan 2015 09:39:56 +0000 Subject: [PATCH] Fixed text replace maching by regular expression git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@111460 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../td/expressionwidget/server/C_ExpressionParser.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/C_ExpressionParser.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/C_ExpressionParser.java index 13527bf..c2c566f 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/C_ExpressionParser.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/C_ExpressionParser.java @@ -623,8 +623,12 @@ public class C_ExpressionParser { C_TextReplaceMatchingRegex textReplaceMatchingRegex = (C_TextReplaceMatchingRegex) exp; TDText tdRegexp = new TDText(textReplaceMatchingRegex.getRegexp() .getValue()); - TDText tdReplacing = new TDText(textReplaceMatchingRegex.getReplacing() - .getValue()); + + String replacement=textReplaceMatchingRegex.getReplacing().getValue(); + if(replacement==null){ + replacement=""; + } + TDText tdReplacing = new TDText(replacement); TextReplaceMatchingRegex textRepRegex = new TextReplaceMatchingRegex( parse(textReplaceMatchingRegex.getToCheckText()), tdRegexp,