Hey there.
I need some help with Extract text action.
When I get notifications like this one
18' Gol! [1] - 0 Jovic L.
I have an action 'Extract text' for saving the result in a variable (result) -in this case result = [1] - 0. And this works always fine.
Then I have another Extract text action for getting the scorer.
The regex is
(?s)(?<=\{v=result} )(.*?)((?=\b ?.\.)|$)
and in that case I would get 'Jovic'.
The problem is that the result could also be 0 - [1] and in this case that regex is giving an error (I guess for having not the escape before [1]):
Error with text manipulation: java.util.regex.PatternSyntaxException: Unrecognized backslash escape sequence in pattern near index 11
(?s)(?<=\0 - [1] )(.*?)((?=\b ?.\.)|$)
I've tried adding another Text Manipulation action before that regex, for replacing '[' with '\[' (and then using the regex (?s)(?<={v=result} )(.*?)((?=\b ?.\.)|$)) but that replace action is giving me the error: Error with text manipulation: java.util.regex.PatternSyntaxException: Missing closing bracket in character class near index 1 [
How can I manage to have a regex working in both cases?
Tanks.
Luigi.
I need some help with Extract text action.
When I get notifications like this one
18' Gol! [1] - 0 Jovic L.
I have an action 'Extract text' for saving the result in a variable (result) -in this case result = [1] - 0. And this works always fine.
Then I have another Extract text action for getting the scorer.
The regex is
(?s)(?<=\{v=result} )(.*?)((?=\b ?.\.)|$)
and in that case I would get 'Jovic'.
The problem is that the result could also be 0 - [1] and in this case that regex is giving an error (I guess for having not the escape before [1]):
Error with text manipulation: java.util.regex.PatternSyntaxException: Unrecognized backslash escape sequence in pattern near index 11
(?s)(?<=\0 - [1] )(.*?)((?=\b ?.\.)|$)
I've tried adding another Text Manipulation action before that regex, for replacing '[' with '\[' (and then using the regex (?s)(?<={v=result} )(.*?)((?=\b ?.\.)|$)) but that replace action is giving me the error: Error with text manipulation: java.util.regex.PatternSyntaxException: Missing closing bracket in character class near index 1 [
How can I manage to have a regex working in both cases?
Tanks.
Luigi.