0

I have to extract all the text inside the curly brackets and at.

This is my template @{test.html} bla bla bla @{test.html}

I need test.html and va This is the pattern I used.

\@{[A-Za-z\.]*}

Works fine but it return also the curly brackets. @{test.html}, @{test.html}

how to exlude them.

Ras
  • 618
  • 1
  • 9
  • 26
  • This depends on the regex implementation I think. c#, js, ruby, ect are slightly diff. You can create a match group and then get values for that group. Though different implementations do it differently as far as I know – David Esteves Aug 01 '14 at 08:46
  • Hi, I'm using C#. I thought about extract value from subgroup but I was thinking to do in one shot (if is possible) – Ras Aug 01 '14 at 08:48
  • http://stackoverflow.com/questions/3512471/non-capturing-group you can look at this, should do what you want – David Esteves Aug 01 '14 at 08:49

1 Answers1

3

The easiest way would probably be to use groups

@{([A-Za-z\.]*)}

http://regex101.com/r/oM0dW6/4

if you don't want to do this

(?<=@{)[A-Za-z\.]*(?=})

http://regex101.com/r/oM0dW6/5

Greetings

PS: Make sure that you really have everything needed to match any given text inside your text-group.

Xevelion
  • 829
  • 6
  • 9