Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Gerry
1
Views
8
Comments
Stripping out punctuation
Question
Does anyone have a quick way of stripping out the punctuation from a string?
Pedro Gonçalves
Staff
Hi Gerry,
Just look for "diacritics" in the Community.
You'll probably find a bunch of good ways to do that:
- RemoveDiacritics component at
https://www.outsystems.com/forge/component/476/removediacritics/
- some posts even give you the actual code to do it:
https://www.outsystems.com/forums/discussion/8224/action-replace/
Happy coding!
Gerry
Thanks.
Using Regex_Replace(Text,"[^\w\s]","",True,True) (from Text extension) works pretty good too.
Pedro Gonçalves
Staff
Great to know another way of doing that. Thanks for sharing, Gerry!
David Rickey
Can someone help me out with the proper systax for the Pattern field? The box stays red and doesn't like anything I put in it. I'm just trying to strip out A-Z & a-z to leave only numbers and the decimal point from an input field.
Extra Info:
We're running version 6
I'm a Sys Admin not a programmer.
I'm trying to use the Regex_Replace Action from the Text Extension before running the CreateOrUpdate Action.
Thank You,
David
André Vieira
Staff
Hi David,
The Pattern field is a Text field and as so you'll need to provide a string with begining and ending quotes (").
If your pattern needs to use a quote then you'll have to double it ("").
Hope this helps you
David Rickey
Thanks Andre, yes quotes are needed but I'm still not doing something right as the record does not get saved if I put a alpha character in the input field.
Here's my Regex_Replace Action
Name - Clean_CMID
Action - Regex_Replace
Text - EditRecord1.Record.Atty_Files.CMID
Pattern - "A" (just for testing)
Replace - "0" ( I actually want to replace with nothing)
IgnoreCase - True
Thanks,
David
AttorneyFiles.oml
André Vieira
Staff
Hi David,
After the RegEx_Replace Action you must assign the output of it to your record.
Go check our
Online Training
, it will help you get started!
This video
shows you how to assign a value before you save it to the database, in your example instead of the FK from the other entity what you want is to assign the output of the regexp action.
Cheers
David Rickey
Thanks again Andre, I thought about that last weekend but I was already in vacation prep mode so I didn't try it until today. I added an Assign operation and once I got the Variable and Value set correctly it worked fine. For some reason I always get those backwards when I first setup an Assign. :\
David
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...