Juramirez
(Julian)
January 15, 2018, 4:48pm
1
Hi all
I’m using Matches activity to get a word between two sentences. All works fine if the LabelBefore and LabelAfter doesn’t have an space inside them (something like “textBefore” and “textAfter”). I need to assign this variables a text that have a space, something like LabelBefore = “spaced text 1” and LabelAfter=“Spaced text 2” but when I do this the Matches activity says that not match was found. How can I solve this?
And if there’s no value, how can get it “Matches Result” as null and not the error that it’s not declared?
Regards,
J.
vvaidya
(Vinay Vaidya)
January 15, 2018, 5:00pm
2
Did you try checking “IgnorePatternWhiteSpace” in Regex Option?
Juramirez
(Julian)
January 15, 2018, 5:02pm
3
Yes, it shows the same error
vvaidya
(Vinay Vaidya)
January 15, 2018, 5:24pm
4
Works for me. Is this you are trying to do? Try with default regex options only.
text : " text 1 helloworld text 2"
regex pattern : "(?<=text 1)(.*?)(?=text 2)"
rkelchuri
(ER.Krishna)
January 17, 2018, 9:28am
5
options = RegexOptions.IgnorePatternWhitespace;
reWorks = new Regex(@"(?<a>)", options);
reDoesNotWork = new Regex(@"( ?<a>)", options);
Juramirez
(Julian)
January 17, 2018, 8:04pm
6
Hi all
I tried it but it doesn’t work. Maybe it’s because my text is like this:
Test example 1
THIS is the text
regex pattern : “(?<=Test example 1)(.*?)(?=is the text)”
It says that is not match. The following regex options are activaded:
Multiline, IgnoreCase, IgnorePatternWhiteSpace.
What can I do?
Regards,
J.
vvaidya
(Vinay Vaidya)
January 17, 2018, 9:11pm
7
IgnoreCase,SingleLine
If any whitespace, you can add trim to your result.
Juramirez
(Julian)
January 17, 2018, 9:16pm
8
It doesn’t work. Says that not match has found. What else can I do? :S
Juramirez
(Julian)
January 17, 2018, 9:39pm
10
It works for two lines but i have a case that nees to take 3 lines. How can I do this?
Juramirez
(Julian)
January 18, 2018, 12:58am
11
Something that I can’t do is to get the data when the example is like this:
Test example 1
word before THIS the text
I want to get THIS but it doesn’t work. This is my pattern:
“(?<=Test example 1 word before)(.*?)(?=the text)”
Options: IgnoreCase, IgnorePatternWhiteSpace
What can I do?