We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
I've had to mess around with regex and ReadyAPI and escaping escape characters. It gets really tricky, but I can show you an example I've been working with:
Here is a standard regex pattern:
[A-Za-z0-9\.,\(\)\-\+@\?:\s]*
To make this work in ReadyAPI / groovy, I have to escape it to look like this:
[A-Za-z0-9\\.,\\(\\)\\-\\+@\\?:\\s]
I am taking a look at your example line and match pattern and will see if I can figure it out. Can you potentially provide a copy of the log file you are trying to parse? It'll be easier to work with what you have, or a mocked up file of what you need to process. That way I'm working with the closest thing possible to the source.
YES.. !!!! :-D
Why this simple help is not a part of your user guide? I did not found any information about escaping by "\\" nowhere.
It works!
I can write simple regex to detect quotes like "\\{\\}" and it matches.
SO I KNOW, that in between { and } is nothing.. so no problem.
I can write simple regex to check if end of line is present:
line.eachMatch("SUCCESS,\\{\\}\\Z")
Thanks a lot.
PS: please add this usefull thing in to your WIKI pages.. where your are explaining RegExp in groovy.. will be nice to know.
I hope, this is with details..
Simpy:
I need to know, if inside of "{}" is nothing..
OR
I need to know, that after "SUCCESS,.." is end of line. Because I am unable to escape "{}" in RegEx.. then I was replaced them by "..". BUT, Problem is, that when some error is in there like "{some error}" the regex "SUCCESS,.." will pass.. MEANS.. this is positive FAILS.. In the end.. I dont know nothing..
Nothing works under ReadyAPI..
No solution? Some strangth behaviour of ReadyAPI? or my mistake?