Page 1 of 1

Posted: Fri Jun 17, 2016 1:57 pm
by UCDI
need more info...

Is it possible to have nested mixed punctuation like blah (other] blah [oops) or do they all match a simple pattern? Can they end with {[( ? or the like?

You should be able to make a single rule that says anything followed by one character in the list of {{( followed by (anything? a pattern? what makes sense here) and ends in one character from the list of ]})

That may not be sufficient for all cases or may even fail on some cases depending on the actual data patterns.

Then you need to replace {{( with [ and the same for ] maybe ?? or extract from there the portion you wanted?

The real catch is just whether the simple rule is sufficient for your data.


--- Some tasks may or may not make sense to do other ways. If I wanted the data in between two brackets, I would pull it out in a transformer.

Posted: Fri Jun 17, 2016 9:18 pm
by ray.wurlod
Try the pattern \[**\]$

Posted: Mon Jun 20, 2016 8:34 am
by igorbmartins
Hello, on the weekend I didiscovered how to do it in a single rule.

*& | & ="[", "(", "{" | ** | & ="]",")","}" | $ ;LIGACLIP CLIP TIT M BRANCO[200]
COPY [3] {CodigoRef}
RETYPE [2] 0
RETYPE [3] 0
RETYPE [4] 0

Thank you guys.

Posted: Mon Jun 20, 2016 3:52 pm
by ray.wurlod
Thank you for posting complete solution.

Note that yours will pick up **[text) for example (mismatched brackets).

But if you are 100% sure that the brackets will always be matched, then your solution will suffice. Otherwise you need a pattern with OR operators.

Posted: Tue Jun 21, 2016 10:26 am
by igorbmartins
Hello Ray, because of that I decided to use this rule. In my data base there are rows with:

bla bla [0001]
bla bla {0002}
bla bla (0003)
bla bla [0004}
bla bla [0005)
bla bla {0006)

Thanks,
Igor Bastos Martins

Posted: Tue Jun 21, 2016 4:01 pm
by ray.wurlod
Given that such is the case, your rule is the perfect choice.