425
Views
5
Comments
How to search  " special character in a string
Question
Application Type
Reactive

How to search " special character inside a string ?  Using Regex Search the pattern is not allowing, if " needs to be checked in a given string

Any help would be appreciated. 


2020-09-18 09-37-36
Devendra Baghel

Hi Kunal,

Try this regex expression . Its a negative match of special characters 

[^A-Za-z0-9]

You can test in below online sites 

https://regex101.com/

https://regexr.com/

Best Regards

Devendra



2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi Kunal,

whenever you want to specify a " in a string literal in OS, you can do that by using "".  (So not only for Regex)

For example, if you want to specify a regex pattern to search for the occurence of "id" in a string, you would use this as literal for your pattern:

"""id"""

Dorine

2020-08-31 05-04-40
Rahul Jain

Hi Kunal,
I have created a demo application for above issue you have raised .
Please check by below URL and find attached OML file.

https://rahul-jain-doitlean.outsystemscloud.com/Application/regex

Hope this will help you :)
Rahul Jain

Regex.oml
UserImage.jpg
vikas sharma
Champion

Actually depends on your exact requirement. Like if you need to search for any special character is there or not can use regex as suggested above.

But if you want to search only for 1 or 2 special character then I think String's index Of method can be used.


2020-07-29 19-08-40
Sanjay Kumar Sahu

If you just want to find any special character in string use Index() in IF condition. Eg. if want to find "&", following can be used with if condition :

Index(yourString,"&",0,False,False) > 0

if want to find and replace, use Regex_Replace() action.


cheers

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.