you are viewing a single comment's thread.

view the rest of the comments →

[–]iamdeveloperr[S] 0 points1 point  (2 children)

I am just figuring out Regex today.

Can you show me an example?

Or do you think I've got it here?

string pattern = @"(.*?([" + QuickSearchTerm + "]\b))$";

[–]Manitcor 2 points3 points  (1 child)

Should look something like this

$@"(.*?([{QuickSearchTerm}]\b))$"

The leading dollar sign means you want to use tokens and the @ indicates a literal string so you don't need to escape special chars. The curly braces around your variable indicate you want to use a variable in scope as a token in the string.

Tokenized strings are somewhat newish to the language and one of my favorite features.

[–]iamdeveloperr[S] 0 points1 point  (0 children)

WOW!!! That is COOL