Classification Rule Builder and Pipes as a delimiter | Community
Skip to main content
May 11, 2016
Solved

Classification Rule Builder and Pipes as a delimiter

  • May 11, 2016
  • 1 reply
  • 1158 views

Hello,

I am working on a regular expression within Classification Rule Builder which would look for the value directly after the a colon (:) but would need to stop when it hits a pipe (|). I am running into difficulties getting Rule Builder to see the pipe in the string as the break point.

example: 

s1:bird|s2:monkey|rsc:animal > dog > puppy|s3:cat|

It seems that sometimes [\\|] works but not all of the time. ex. (s2)\:(.+)[\\|](.+|$)

Thanks! smiley

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Hyder_Ziaee

Hi Jessica, 

I just saw this question. Not sure, if you are still interested in the answer.

 

You can create the regex in the following manner

s2:([^|]*)

So the "s2:" identifies the marker after which the value needs to be captured. 

The "[^|]" is a condition to look for any character except the pipe symbol.So it breaks if it finds one. and returns all the characters before it.

 

1 reply

Hyder_Ziaee
Adobe Employee
Hyder_ZiaeeAdobe EmployeeAccepted solution
Adobe Employee
July 23, 2016

Hi Jessica, 

I just saw this question. Not sure, if you are still interested in the answer.

 

You can create the regex in the following manner

s2:([^|]*)

So the "s2:" identifies the marker after which the value needs to be captured. 

The "[^|]" is a condition to look for any character except the pipe symbol.So it breaks if it finds one. and returns all the characters before it.