Regex_Match with multiple strings and ()
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Guys,
I'm trying to filter the following strings from a column by using REGEX_MATCH. The issue here is few of them have '()' and I tried using the following formula but it doesn't seem to be working
American Depository Receipt (ADR)
Corporate Bond
Government Bond
Global Depository Receipt (GDR)
REGEX_Match([Security Type], 'American Depository Receipt\s\(ADR\)\Corporate Bond/Government Bond\Global Depository Receipt\s\(GDR\)')
Is there any other way I can do this?
Solved! Go to Solution.
- Labels:
- Regex
- Tips and Tricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Regards to your REGEX, the alternation character is "|" and not "\"
REGEX_Match([Security Type], 'American Depository Receipt\s\(ADR\)|Corporate Bond|Government Bond|Global Depository Receipt\s\(GDR\)')
Still I think you could use a Contains Function which would work better than a REGEX in terms of performance.
Cheers,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
Just wanted to chime in with one more recommendation - if you're looking for a series of different terms, and only those specific terms, the Find Replace Tool is great for this, since you can easily configure it to scale better, where a Contains() format (or a RegEx) might become very difficult to read if you had more than 3 or 4 search terms.
You can configure Find Replace to Append fields when it finds a match, and then filter out any case where there is or is not a match using that new column.
From a pure speed perspective, it may be slower than a Formula or a RegEx (although not by much), but it is a lot more maintainable in my opinion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks @Thableaus. For some reason Contains wasn't working and I came across Regex in few discussions as an alternative.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks @Claje . I will keep this in mind.
