[
https://issues.apache.org/jira/browse/METRON-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16082772#comment-16082772
]
ASF GitHub Bot commented on METRON-933:
---------------------------------------
Github user JonZeolla commented on a diff in the pull request:
https://github.com/apache/metron/pull/638#discussion_r126778701
--- Diff:
metron-stellar/stellar-common/src/test/java/org/apache/metron/stellar/dsl/functions/RegExFunctionsTest.java
---
@@ -0,0 +1,70 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.metron.stellar.dsl.functions;
+
+import org.apache.metron.stellar.dsl.ParseException;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static
org.apache.metron.stellar.common.utils.StellarProcessorUtils.runPredicate;
+
+public class RegExFunctionsTest {
+
+ // test RegExMatch
+ @Test
+ public void testRegExMatch() throws Exception {
+ final Map<String, String> variableMap = new HashMap<String, String>()
{{
+ put("numbers", "12345");
+ put("numberPattern", "\\d(\\d)(\\d).*");
--- End diff --
Ahh, right sorry. So no need to do this when specifying within Stellar,
just in the tests - sounds good.
> STELLAR support for setting fields to regex match captures
> ----------------------------------------------------------
>
> Key: METRON-933
> URL: https://issues.apache.org/jira/browse/METRON-933
> Project: Metron
> Issue Type: New Feature
> Reporter: Otto Fowler
> Assignee: Otto Fowler
>
> The capability to do a regex on a field, and set one or more fields to the
> resulting captures would be useful.
> https://docs.oracle.com/javase/tutorial/essential/regex/groups.html
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)