0

I've got a really large array that i need to replace some stuffs in it ( using notepad++ regular expression search and replace ) but i don't the right Regex for it , and everything i tried failed.

Example :

'label' => 'Some text',

Must be replaced with :

'label' => __('Some text', 'mytextdomain'),
0

1 Answer 1

2

Make sure that the Regular Expression radio button is clicked on the Search Mode panel of the Replace dialog. Then

Find what: ('[^']*') => ('[^']*') Replace with: \1 => __\(\2, 'mytextdomain'\)

The main thing is that if you want parenthesis in your result they need to be escaped because parenthesis are special just like ^ & . + and *

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.