Skip to content
Snippets Groups Projects
Commit 3b32aa63 authored by cramakri's avatar cramakri
Browse files

LMS-1349 Fixing translation of user-specified regex patterns (with "regexp"...

LMS-1349 Fixing translation of user-specified regex patterns (with "regexp" prefix) to patterns meant for server consumption.

SVN: 14495
parent a996d903
No related branches found
No related tags found
No related merge requests found
...@@ -94,6 +94,9 @@ public class DataSetUtils ...@@ -94,6 +94,9 @@ public class DataSetUtils
result = StringUtils.escape(result, REGEXP_METACHARACTERS_TO_ESCAPE); result = StringUtils.escape(result, REGEXP_METACHARACTERS_TO_ESCAPE);
result = result.replace("*", ".*"); result = result.replace("*", ".*");
result = result.replace("?", "."); result = result.replace("?", ".");
} else
{
result = result.substring(REGEXP_PREFIX.length());
} }
return result; return result;
} }
......
...@@ -33,14 +33,15 @@ public class DataSetUtilsTest extends AssertJUnit ...@@ -33,14 +33,15 @@ public class DataSetUtilsTest extends AssertJUnit
{ {
return new Object[][] return new Object[][]
{ {
{ DataSetUtils.REGEXP_PREFIX + "file_.+\\.*", { DataSetUtils.REGEXP_PREFIX + "file_.+\\.*", "file_.+\\.*" },
DataSetUtils.REGEXP_PREFIX + "file_.+\\.*" }, { "file$^.|(1){2}<3>+", "file\\$\\^\\.\\|\\(1\\)\\{2\\}\\<3\\>\\+" },
{ "file$^.|(1){2}<3>+", "file\\$\\^\\.\\|\\(1\\)\\{2\\}\\<3\\>\\+" }, { "dir\\file", "dir\\\\file" },
{ "dir\\file", "dir\\\\file" }, { "file.*", "file\\..*" },
{ "file.*", "file\\..*" }, { "file.?", "file\\.." },
{ "file.?", "file\\.." }, { "*.tsv", ".*\\.tsv" },
{ "*.tsv", ".*\\.tsv" }, { "file[0-9].txt", "file[0-9]\\.txt" },
{ "file[0-9].txt", "file[0-9]\\.txt" }, { "*.", ".*\\." },
{ ".*", "\\..*" }
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment