I have a very large string (HTML) and in this HTML there is particular tokens where all of them starts with “#” and ends with “#”
Simple Eg
<html>
<body>
<p>Hi #Name#, You should come and see this #PLACE# - From #SenderName#</p>
</body>
</html>
I need a code that will detect these tokens and will put it in a list.
0 – #Name#
1 – #Place#
2 – #SenderName#
I know that I can use Regex maybe, anyway have you got some ideas to do that?
Yes you can use regular expressions.
As you might have guessed \w denotes any alphanumeric character. The + denotes that it may appear 1 or more times. You can find more info here msdn doc (for .Net 4. You’ll find other versions there as well).