php - Text Inside Parantheses with Smarty -


i have text .com registration (domain.com) or xl hosting (domain.com)

i want domain inside parantheses smarty.

how can that?

you can use following regex:

/(\([^)]+\))/g 

edit: in previous expression domain or whatever inside parentheses captured in group 1, can access matched in group.

regex 101 demo

if need replace except inside parentheses can use following expression:

\g[^(]*(\([^)]+\)) 

regex 101 demo


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -