Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Commit

Permalink
Search EUDAT/REPLICA for to be added replicas using case insensitive …
Browse files Browse the repository at this point in the history
…search
  • Loading branch information
Robert Verkerk committed Nov 21, 2018
1 parent 846a041 commit 1cc0179
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
21 changes: 21 additions & 0 deletions cmd/regex_search_string.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env python

import re
import sys

def search_pattern_in_string(pattern, string):
"""
search_pattern_in_string. Search if a pattern matches in a string.
return match in string if found.
return "no match found!" if not found
"""
searchObj = re.search(pattern, string, re.U|re.I)
if searchObj:
print searchObj.group()
else:
print "no match found!"

if __name__ == "__main__":

search_pattern_in_string(sys.argv[1], sys.argv[2])

4 changes: 3 additions & 1 deletion rulebase/pid-service.re
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ EUDATUpdatePIDWithNewChild(*parentPID, *childPID) {
*replicaNew = *childPID;
}
else {
if (*replica like "*"++*childPID++"*") {
msiExecCmd("regex_search_string.py","*childPID *replica", "null", "null", "null", *status);
msiGetStdoutInExecCmdOut(*status, *response);
if (*response not like "no match found!") {
*replicaNew = *replica;
}
else {
Expand Down

0 comments on commit 1cc0179

Please sign in to comment.