Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • Yay, seems nice! How could I just get the {{ }} content, getting the file doesn't really matter and force me to do more treatment :) #thx! Commented Mar 1, 2012 at 9:46
  • Nice, I've found, using my previous command and your rightfull pattern. Thx dude! Commented Mar 1, 2012 at 9:48
  • hum, now with my command: find src/ -type f -name '*.twig' -execdir egrep -o -- "\{\{[^|(){]*\|[(trans) ^}]*\}\}" {} \; | sed 's/([a-z ]*).*/\1/' I got {{ "my whith ' quotes' inside trans" | trans }} or {{ 'my other trans' | trans }}. How to get only what's insinde '' or "" ? thx! Commented Mar 1, 2012 at 11:06
  • Try to pipe the result through egrep -o '"[^"]+"|'"'[^']+'" | sed -r 's@^.(.*).$@\1@' (note the nesting of quotes, it's tricky) Commented Mar 1, 2012 at 13:11