关联下拉列表
我有一个下拉列表,其中的值是:
store:[ ['1', 'Probation'], ['2', 'Confirmed'], ['3', 'Trainee'], ['4', 'Contract'] ],
我想使用 split 函数分割字符串来获取:
[['1', 'Probation'],
['2', 'Confirmed'],
['3', 'Trainee'],
['4', 'Contract'] ],
然后,我可以使用正则表达式并提取值 1、2、3、4 或缓刑、确认、等等并将其传递给请求。
有人能帮我解决这个问题吗?我想知道分割后的字符串到底在哪里可以看到,应该在哪里调用它,以及如何对分割后的字符串使用正则表达式。
I have a drop-down list in which the values are:
store:[ ['1', 'Probation'], ['2', 'Confirmed'], ['3', 'Trainee'], ['4', 'Contract'] ],
I want to split the string using a split function to get:
[['1', 'Probation'],
['2', 'Confirmed'],
['3', 'Trainee'],
['4', 'Contract'] ],
Then, I can use regular expressions and pull the values 1, 2, 3, 4, or probation, confirmed, etc. and pass it to a request.
Can anybody help me with this? I want to know where exactly I can see the string after splitting, where I should call it, and how to use regular expressions for the split string.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要拆分字符串来对其执行正则表达式 - 您只需将 Regex 后处理器添加为请求的子级即可。
如果您确实想要进行拆分,则需要添加后处理器 BeanShell 断言作为代码的容器。
You don't need to split the string to do a regular expression on it - you'd just add the Regex post processor as a child of your request.
If you do want to do the split, you'd want to add a post-processor BeanShell Assertion as a container for your code.