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.
Let me involve our Groovy experts into this thread.
avidCoder, groovyguy , what do you think about this behavior?
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.