How can I swap [text] - [text]
Hello,
What is the best way to swap like below example so the text within the square brackets and the square brackets change place
Old situation:
image - [name] - [San Fransisco].jpg
image - [name, name & name] - [San Fransisco].jpg
video - [name & name] - [San Fransisco].mp4
video - [name] - [Los Angeles].mp4
New situation
image - [San Fransisco] - [name].jpg
image - [San Fransisco] - [name, name & name].jpg
video - [San Fransisco] - [name & name].mp4
video - [Los Angeles] - [name].mp4
What is the best way to swap like below example so the text within the square brackets and the square brackets change place
Old situation:
image - [name] - [San Fransisco].jpg
image - [name, name & name] - [San Fransisco].jpg
video - [name & name] - [San Fransisco].mp4
video - [name] - [Los Angeles].mp4
New situation
image - [San Fransisco] - [name].jpg
image - [San Fransisco] - [name, name & name].jpg
video - [San Fransisco] - [name & name].mp4
video - [Los Angeles] - [name].mp4
Replace: (\[[^\]]*\])([^\[]*)(\[[^\]]*\])
with: \3\2\1
Use regular expressions
with: \3\2\1
Use regular expressions