cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
lala
Level VIII

How do replace these with JSL with regex substitution?

This is copied in the browser. How to use JSL's regular substitution is processed into syntactic JSL with the following requirements:
1, contains POST......HTTP/1.1 replaced with: u="...";h=[=>];
2, containing:, write h
3. The last line..., replace with: jj="...";rs=New HTTP Request(URL(u),Method("POST"),JSON(jj),Headers(h));

Thanks!

 

POST https://app.com/w1/api HTTP/1.1
Host: apparticle.longhuvip.com
Connection: keep-alive
Content-Length: 87
Accept: application/json, text/javascript, */*; q=0.01
Origin: https://app.com
User-Agent: Mozilla/5.0 (Linux); 5.11.0.6
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: https://appp.com/w33/community/refreshKey=1696089600
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,en-US;q=0.8
X-Requested-With: com.aiyu.kaipanla

c=ForumsMsgJX&a=GetInfo&MsgID=30927&Tag=1&DeviceID=ffffffff-e4d8-03bc-ffff-ffffb561792e
11 REPLIES 11
jthi
Super User

Re: How do replace these with JSL with regex substitution?

What do you need the item count for? Str is a string, not a list so you cannot use N Items on it (you need to use the splitter version which you get using Words()).

-Jarmo
lala
Level VIII

Re: How do replace these with JSL with regex substitution?

  • Thank you. I just wanted a different substitution in the last line