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.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive