RegEx replace 3 character string with blank
- 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
I am trying to use Regex to recognize the strings with 3 characters and replace them with nothing. Example,"IDC". What would be the syntax for this?
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Assuming you want to replace any instance of IDC and leave the rest of the string intact: In a formula tool, something like REGEX_Replace([Field1], 'IDC', '') should work. In the regex tool the below screenshot's configuration will do the same thing as the above formula.
A non-regex solution would be: replace([Field1],'IDC','')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I actually need to identify any string that's 3 characters and not just IDC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Ah, sorry I misread. Is there any reason you want to use regex rather than a formula like the one below that checks the length?
if Length([Field1]) = 3 then '' else [Field1] endif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
This is a length of 3 or 3 letters in a string of numbers?
If the latter than:
if REGEX_Match([test],".*[a-z]{3}.*") then "" else [test] endif will work for you.
if more than 3 is an option {3} should be {3,}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks Luke!
