Is there a way using a regular expression to split a string of text such as an address by a number of words/spaces? Or even more functional, split a line at the first space after a certain number of characters?
Solved
Splitting Attributes by number of words
Best answer by takashi
Hi @gmbutler2, the StringReplacer with this setting transforms a single line address string into your desired multi-line string at once.
- Mode: Replace Regular Expression
- Text To Replace: (.{19,}?)\s
- Replacement Text: \1<newline character>
Alternatively, this string expression does the trick too. Assuming that an attribute called "address" stores the original single line address string.
@ReplaceRegEx(@Value(address),(.{19,}?)\s,\1
)
Reply
Rich Text Editor, editor1
Editor toolbars
Press ALT 0 for help
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.