Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Classification Rule Builder and Pipes as a delimiter

jessica_mays
Level 1
Level 1

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

1 Accepted Solution
hyderziaee
Correct answer by
Employee
Employee

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.

 

View solution in original post

1 Reply
hyderziaee
Correct answer by
Employee
Employee

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.

 

View solution in original post