Reputation: 6592
I have the following string
[function('lookup')]
I want to extract the string lookup
from the string above.
Tried doing using
var lookup = Regex.Match("[function('lookup')]", @"'\b\w*\b'").Value;
I end up getting 'lookup' with the single quotes instead of just lookup.
Where am I going wrong ?
Upvotes: 0
Views: 25
Reputation: 12546
You can do it as:
var lookup = Regex.Match("[function('lookup')]", @"'\b(\w*)\b'").Groups[1].Value;
Upvotes: 1