'I am writing a DXL script to print a modulename with path using a function . I need to remove if the directory has remote in that path

Below module is forming a directory from a path

Checkmodules("Cus", "projectname".cfg", ".*(Cus|Cer Requirements|Cer Speci|ASM|/ASM24e|Specs).*");

The above line forms below folder directory, so I need to modify it when the directory has remote in the path its should be removed entire directory.

Output path

Cus/spec/cer/
cus/val_remote/value - this also needs to be removed
Cus/sys/remote   ---- to be removed entire path


Solution 1:[1]

You can do a replace (to an empty string) with the following regex combined with the flag g (global=all occurrences) and m (multiline)

^.*remote.*$

In JavaScript this would be :

outputPath.replace(/^.*remote.*$/gm, '')

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Michel Lamsoul