Hi all,
I am trying to use an IsMach activity with advanced option selected and the regex: “\b[O|o](ut|UT) .\s [O|o](f|F) .\s [O|o](ffice|FFICE) \b”
It should be able to match (OOO, ooo, Out of Office or any combination of out of office), this works fine and returns true when the input text contains such words, however, the problem is that it also returns True, for when the input is (POD Request Multiple, or POD Request Single), it should return false in this case.
Any ideas, would be much appreciated. Thank you.
ppr
(Peter Preuss)
August 26, 2022, 7:33pm
2
@Sidney_Vogel
You asked about the isMatch, but we do see your question more related to the Regex Pattern
Have a look here:
we enabled the Case Insensitive RegexOption and reduced the complexitiy of the pattern
This CheatSheet introduces the basic use of regex functions. With further examples also special cases are presented.
Introduction
From the namespace System.Text.RegularExpressions following methods are offered:
Regex.Match
Regex.Matches
Regex.isMatch
Regex.Replace
Regex.Split
A simple usage for example would look like this:
[grafik]
Recommendation:
add System.Text.RegularExpressions to the imports:
[grafik]
it allows to use the shortened statement, as the namespace part can be ommited…
Regex.IsMatch(YourString, "OOO|OUT OF OFFICE", RegexOptions.IgnoreCase)
Hey @Sidney_Vogel ,
Apply the following properties to the isMatch activity to get the desired result.
Thanks,
Sanjit
Thank you this helps, but what’s wrong with this expression: “\b[O|o](ut|UT) .\s [O|o](f|F) .\s [O|o](ffice|FFICE) \b”, meaning why does it return true for (POD Request Multiple, or POD Request Single)?
ppr
(Peter Preuss)
August 26, 2022, 8:06pm
5
Kindly note: Code snippets are better to format with the </>
from the editor as it can partly interpreted as Mark Down code
Sorry, here \b[O|o]*(ut|UT)*\.*\s*[O|o]*(f|F)*\.*\s*[O|o]*(ffice|FFICE)*\b
ppr
(Peter Preuss)
August 26, 2022, 8:15pm
7
we do see unwanted matches but not on POD
In general we do feel that your initial question was answered
Forum FAQ - How to mark a post as a solution
This document is part of our beginners guide .
This article will teach you how to properly mark a post as a solution.
We were closely following our last UiPath Forum feedback round! topic and carefully extracted all the bits of feedback that was provided. As such, we would like to tackle the topic of solutions on our Forum and how to properly use them.
When is the topic resolved?
The topic can be considered resolved when the topic author has fo…
Yes the question was answered and thank you for that I just wanted to understand the issue.
Thank you for all the help. Much appreciated.
system
(system)
Closed
August 29, 2022, 8:23pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.