what will be the regular expression of highlighted values? - regex

{"id":"mergeresult:68b2a5f3-f22a-40c7-b6d0-728ca3f4ede2:2020-06-25:fd18a85c-a1a8-40ae-859a-465b6b9b13a8","mailMergeId":"1636afe5-d103-45d1-8786-d13022d92e07"}
This is the response I a m getting from api and I want this 1636afe5-d103-45d1-8786-d13022d92e07 in my output variable without quotes and also mergeresult:68b2a5f3-f22a-40c7-b6d0-728ca3f4ede2:2020-06-25:fd18a85c-a1a8-40ae-859a-465b6b9b13a8
so basically I want id and mailMergeId value without quotes so that I can pass it into next api request

This is for your id of type 8-4-4-4-12
[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}

Related

How to pass inverted commas through URL in ColdFusion?

I wanted to pass two parameters through the URL. One with varchar data type and the other with int. The varchar one includes characters, numbers and - for example: wfsjjhc122-hdggb11-2weeee-yu. When I am passing this through URL via queryString. It gives me an error saying incorrect syntax near wfsjjhc122-
I am currently not using quotes. The query string is like pagname.cfm?id=wfsjjhc122-hdggb11-2weeee-yu&no=123.
Should it be something like pagname.cfm?id='wfsjjhc122-hdggb11-2weeee-yu'&no=123? If so how can I pass inverted commas? Currently when I am trying to do so but browser is automatically adding %27 instead of '.
<td bgcolor="#bgColor#">View</td>

extract value from the url by using a regex

I have this string value
var x = '/index.cfm?act=page1.showdata';
want to extract page1
if i had to use it as simple, i am use contains to find it and make it work, but i really want to use regex to find that value and put it into a variable,
using coldfusion
No need for regex. Every query string parameter is available in the url scope. They're all already variables.
<cfdump var="#url#">
This dumps a struct whose keys are the parameters.
So the CF variable url.act has a value (string) of page1.showdata.
What else do you need than that?

Save substring from field to copyfield using regex in Solr

I'm importing data from mysql table using import handler. I have a column msg, of type text. Using regex, I have to save substring in a copy field.
msg: 94eb2c0cb17ef354bb052c57f40c\r\nContent-Type: text/plain; charset=UTF-8\r\nContent-Transfer-Encoding pnr:986|0978325
Expected Solr result:
{
"msg_body": "94eb2c0cb17ef354bb052c57f40c\\r\\nContent-Type: text/plain; charset=UTF-8\\r\\nContent-Transfer-Encoding pnr:986-0978325",
"pnr_number": "pnr:986-0978325"
}
My REGEX:
(pnr|(P|p)[ _.:,!"'-/$](N|n)[ _.:,!"'-/$](R|r))+[ _.:,!"'-/$]+[0-9]{3}[ _.:,!"'-/$]+[0-9]{7}
Please help me out as i'm new to solr
You'll need to define a custom field for pnr_number.
Use a copyField to copy msg_body to pnr_number
In the custom field definition, use
<filter class="solr.PatternCaptureGroupFilterFactory" pattern="regex goes here" preserve_original="false"/>
Since you are using Data Import Handler, you have 3 options:
Use a Regex Transformer in DIH definition.
Use a RegexReplaceProcessorFactory Update Request Processor (in solrconfig.xml).
Use a Regex filter in the analyzer chain
With the first two options, the regex will extract the pattern before the field is actually indexed. In the last option, the stored representation (if you store the field) will contain the original full string, but the indexed (searchable) representation will contain regex match.

regular expressionn not able to correlate my test scenario with viewsate in jmeter

I have tried with regular expression also with css/j query extractor,not able to run my script properly.
My exact test scenario is kind of
There is kind of application form.
First Load the page.
Fill with some data, then go to next page.
Now again fill some details, and Submit.
Note:For Each and every 'application form' there is two "9" digit unique number , which gets generated from server side, and after participating the form there is two options:
a)Access Count
b)Response Count
Every time J meter thread group hits the page 'Access count' properly gets increased , but Response Count not gets change, it should get increase for each user as well.
I have tries to correlate both the parameter using regular expression and css/j query expression , but still the 'Response Count' not gets increment. What should I do for this case to do Load test in J meter.
Viewstate regular expression
Change parameter
Regular Expression: input[id=_VIEWSTATE]
While Checking the response data in
result tree its showing different in Load page and next Page.
Add Regular Expression Extractor as a child of the first request.
Configure it as follows:
Reference Name: VIEWSTATE
Regular Expression: <input type="hidden" name="javax\.faces\.ViewState" id="javax\.faces\.ViewState" value="([^"]+)".*/>
Template: $1$
Refer extracted value as ${VIEWSTATE} where required.
By the way, you can test your Regular Expressions right in View Results Tree listener using RegExp Tester view.
The regular expression is wrong.
input[id=_VIEWSTATE] can' t capture a value.
You can test it in regular expression tester of response.
It may be something like: input[id=(.*?)]
It depends on your dynamic value. But in question you didnt mention screenshot of that dyanamic data.

Processing QuerySet result

I have the following code to validate user credentials
userDetail = User.objects.using (settings.DATABASE_CONF).filter (status=1, email_id=emailId, password=password).values
('user_id' , 'email_id' )
Im able to validate it and get the result. I want to Print user_id into my console and also set it in session object. I tried
if userDetail :
But it returns true even if the userDetail list is empty.
I tried
for n in userDetail:
It says "'instancemethod' object is not iterable"
How to validate it is empty or null and take the value of user_id?
You can't split a method call before the parentheses. What you have done there is assign userDetail to the method values, not the result. Bring the parens back onto the previous line - if you must split, you can do it after the open paren.