vb.net regex
I have some strings like this to analyze:
<%JohnSmith$>@ some other text @<%FredJonese%>@ (@<%SallyHarris%>@)@
I need to find occurrences of each block of text that's between <% and %> and also those between each pair of @ symbols.
So for the above example, I want to retrieve the following 6 pieces of text (there is a leading space in the 2nd and 4th lines below):
JohnSmith
some other text
FredJones
(
SallyHarris
)
When I use a patter like "<%\w%> it retrieves the entire line because the line starts and ends with <% and %>
I'm lost on the best way to do this. I need to get the chunks out in the order in which they occur.
Nothing I've tried so far is working. I know I could write a loop that goes through the string character by character but it seems like regex can handle this. Can anyone help out on this?
Thanks.