Using RegEx to split a column at a delimeter
I currently am working with a column that is delimited using underscores. I was able to write the following RegEx in a builder which was able to do what I needed: ^(?:[^_]+)
What is the best way to implement this RegEx to return the part of the string that this captures?
Best Answers
-
Have you looked at the Split Column tile in Magic ETL?
If I solved your problem, please select "yes" above
2 -
You can use a formula tile and the REGEXP_REPLACE function to get just the value of your match. There isn't a regex substring function so you essentially have to match the entire string and then replace it with your value:
REGEXP_REPLACE(`field`, '^(?:[^_]+).*$', '$1')
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2
Answers
-
Have you looked at the Split Column tile in Magic ETL?
If I solved your problem, please select "yes" above
2 -
You can use a formula tile and the REGEXP_REPLACE function to get just the value of your match. There isn't a regex substring function so you essentially have to match the entire string and then replace it with your value:
REGEXP_REPLACE(`field`, '^(?:[^_]+).*$', '$1')
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**2
Categories
- All Categories
- 1.5K Product Ideas
- 1.5K Ideas Exchange
- 1.4K Connect
- 1.1K Connectors
- 280 Workbench
- 4 Cloud Amplifier
- 4 Federated
- 2.7K Transform
- 90 SQL DataFlows
- 563 Datasets
- 2K Magic ETL
- 3.4K Visualize
- 2.3K Charting
- 592 Beast Mode
- 13 App Studio
- 28 Variables
- 588 Automate
- 143 Apps
- 417 APIs & Domo Developer
- 27 Workflows
- 1 DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 361 Distribute
- 99 Domo Everywhere
- 260 Scheduled Reports
- 2 Software Integrations
- 94 Manage
- 91 Governance & Security
- 9 Product Releases
- Community Forums
- 37 Getting Started
- 28 Community Member Introductions
- 90 Community Announcements
- 4.8K Archive