Regex Question to Grab Keys

Posted by Braveyard on Stack Overflow See other posts from Stack Overflow or by Braveyard
Published on 2010-04-19T19:13:29Z Indexed on 2010/04/19 19:43 UTC
Read the original article Hit count: 207

Filed under:
|

Hello,

I have this kinda template text :

Hello {#Name#},

Thanks for coming blah on {#Date#} and we love to see you again here with {#President#}

So I am trying to get {#...#} templates parts and put them into an array.

But my expression didn't work :

\b(?<=\{\#)(.*)(?=\#\})\b

The result became something like this for this sample text :

{#Something#} Hello {#Brand#} 

Result :

Something#} Hello {#Brand

© Stack Overflow or respective owner

Related posts about regex

Related posts about c#