Reputation: 184
I am struggling extracting values from the followin
https://hlapservice0i/Web/api/Purchaselist/Creditor?
filter[logic]=and&
filter[filters][0][value]=John Doe &
filter[filters][0][field]=customFilter&
filter[filters][0][operator]=contains&
filter[filters][0][ignoreCase]=true
I'm trying to get that John Doe
value stored in filter[filters][0][value]
It is a simple MVC controller.
Upvotes: 0
Views: 146
Reputation: 9606
You could do like this..
var match = Regex.Match(input,@"(?<=filter\[filters\]\[0\]\[value\]=).*?(?=&)");
match.Value
will have value you are after, which is John Doe
Explained:
?<=
forces match to start after first occurrence of filter[filters][0][value]
.
?=
forces match to end before following character, which is, in this case, &
Upvotes: 1