You are viewing limited content. For full access, please sign in.

Question

Question

Need to have pattern matching recognize the Pipe (|) character.

asked on June 26, 2015

I have metadata on files that were migrated into Laserfiche from another program.  They came in with pipes (|) in the fields.  Does anyone know of a way I can get pattern matching to recognize the | character as a splitting point?  For example, in the screenshot below I would want to take this one field split it into 2 fields based on where the | is.

 

 

Thanks.

0 0

Answer

SELECTED ANSWER
replied on June 26, 2015

While you can use pattern matching, what I would recommend just using the split function in assign token values. Then just use the Trim to clean it up, and lastly just use the value at Index 1 or 2 to set it into fields.

You can do this all inside a single assign field values activity.

Split.PNG
Split.PNG (33.24 KB)
2 0
replied on June 26, 2015

Works great! Didn't even think of using functions instead of applying an expression.  Thanks.

0 0

Replies

replied on June 26, 2015

You can use token functions instead of pattern matching to split the token on a given character.  Or if you want to use pattern matching, then you can use the "any character not in range" construct: [^charactersGoHere]. For ex, ([^|])+ returns everything before the pipe if pattern matching is set to "first match only" and a 2-value token if set to "all matches as a multi-value token".

2 0
replied on June 26, 2015 Show version history
 
 
 
 

Escape the pipe with "\"

 

Example: piped|Content

Regex: (?:.*)\|(.*)

Result: Content

 

Example: piped|Content

Regex: (.*)\|(?:.*)

Result: piped

 
 
1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.