Some useful Regex statements
ToDo:
Use an Edit Data --> Replace Text action in the workflow.
Select Regex option and replace by empty string.
You can also replace the match with any string you require.
Get Handles:
Example: Hi @Something how are @you doing David.
Result: @Something @you
Get Hastags:
(^|\s|[^#\w])+[^#\s]+
Example: Hi #Something how are #you doing David.
Result: #Something #you
Remove Handles:
(?=(@\w+\b))
Example: Hi @Something how are @you doing David.
Result: Hi how are doing David.
Remove Hashtags:
(?=(#\w+\b))
Example: Hi #Something how are #you doing David.
Result: Hi how are doing David
Get a word or phrase:
\b(?!cat\b)\w+
Example: This cat is beautiful!!
Result: cat
Except a word or phrase:
\b(?=cat\b)\w+
Example: This cat is beautiful!!
Result: This is beautiful!!
Get Character(s):
Get 1st four characters (including space)
(?<=.{4}).+
Example: This cat is beautiful!!
Result: This
Get last four characters (including space)
.+(?=.{4})
Example: This cat is beautiful!!
Result: ul!!
** I will append more Regex scenario as I go through them. Please feel free to add or comment on the scenarios you go through more frequently and I will try to append it asap.
Comments
-
Select all the characters before a character or word:
.*are)
Example: Hi #Something how are #you doing David.
Result: Hi #Something how
Select all the characters after a character or word:
are.*
Example: Hi #Something how are #you doing David.
Result: #you doing David.
1 -
Hi NFSharma,
Thanks for sharing these formulas.
Do you have anything for the last 2 formulas for all characters before and after, for a multi-line field ?
I've tested this out on Regex101 website
^(?!Numbers:).*
and it works, removing all text except for the bold text below, but does not work in Domo,
______________________________ OVERVIEW ______________________________
Booking Error: DangerousGoodContact 1.67.10 - Unable to add an item that has dangerous goods information without adding a dangerous goods contact name and phone number.
Carrier: Transport Express - Parcel
Account Number: TRS74844
Site: Solid Items - VIC
45 Yellow Court, Bentleigh East VIC 3168
Phone: -
User: Sales
Email: sales@soliditems.com.au
Phone: -
Consignments: 5A
Numbers: SOSO101951 SOSO101954 SOSO101952 SOSO101953 SOSO101955
Largest Dimensions: 26x49x32 cm
Total Weight: 49.0 kg
Total Cubic: 0.1623 m3
Total Items: 5
Dangerous Goods: YES
0 -
Hi @Domofied
If you have Magic ETL 2.0 you can use the regex_replace function to pass in processing flags - this isn't possible with the ETL 1.0 Replace Text tile. By default regex101 as the g (global) and m (multiline) flags enabled whereas Domo does not. Passing in the 'm' as the third parameter should resolve your issue.
REGEXP_REPLACE(`note`, '^(?!Numbers:).*', '$1', 'm')
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Hi Grant,
That makes sense ! Hahahahaa 😂
I'm currently working with ETL v1.0 so would there be any possible work arounds to handle multi-lines ?
Cheers!
0 -
Hi @Domofied
You might be able to do this as a calculated field in a Dataset View but because you're on ETL 1.0 you wouldn't be able to use it as an input into your dataflow. It'd have to be your last step before you visualize your data.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 296 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive