Closed GoogleCodeExporter closed 9 years ago
PWM uses the Java regular expression engine:
http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html
It's not going to change.
I believe if you proceed the expression with (?m), you'll enable multi-line
mode matching which is probably what you want.
Original comment by jrivard
on 24 Oct 2011 at 11:34
I'm all for doing it myself instead of changing the code (I didn't
suggest you change the Regex enging, just the flag to match newline as
dots). I wasn't aware of the ability to set flags myself.
The ?m suggestion however doesn't do the trick I'm afraid:
2011-10-24 13:37:33, ERROR, util.SmsQueueManager, unexpected exception
while processing sms queue: Dangling meta character '?' near index 0
?m.*OK.*
^
java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0
?m.*OK.*
^
at java.util.regex.Pattern.error(Pattern.java:1713)
...
Original comment by mrva...@gmail.com
on 24 Oct 2011 at 11:40
(?s).*OK.* does the trick.
I'll post the solution to the mailinglist as well for documentation's sake.
Original comment by mrva...@gmail.com
on 24 Oct 2011 at 11:46
Groovy. Thanks for following up. Menno: should this be added as the default
flag for this setting? /methinks thats a little confusing, but thats what the
reporter is suggesting. Up to you.
Original comment by jrivard
on 24 Oct 2011 at 5:37
Thinking it over, I've made some changes anyway. It turns out that the response
is evaluated as a single string in the current implementation, against each of
the configured regexes.
Therefore, I've set the DOTALL option as default now. This can be overruled, by
using (?-s), if required in any configured regex.
Original comment by menno.pi...@gmail.com
on 2 Nov 2011 at 10:05
Original issue reported on code.google.com by
mrva...@gmail.com
on 24 Oct 2011 at 11:25