Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Perpending and appending string #1

Closed
alessandrodallafina opened this issue Feb 6, 2017 · 3 comments
Closed

[Feature request] Perpending and appending string #1

alessandrodallafina opened this issue Feb 6, 2017 · 3 comments

Comments

@alessandrodallafina
Copy link

First of all, awesome plugin! I looove ti!

Just a small side note. Not sure how hard would it be supporting the prepending/appending feature. This way users can keep the layer name and simply appending other strings without affecting the original values.

Just a thought ;)

@leonardpauli
Copy link
Owner

Haha, thanks! Of course it's supported! Just put parenthesis around your find expression (it's regular expressions after all) and then prefix$1suffix as the replacement! With regex, you can even do a lot more powerful things! Try pressing the help-button (?) in the corner of the dialog :)

Examples:
Find: stone (anywhere, case-insensitive, in the name)
Replace: flower
With the layers with the following names selected
hello stone -> hello flower
hello tree -> hello tree (no match)
thestonemaster -> theflowermaster

Find: ^stone$ (exactly, case-insensitive, ^ is the start, $ is the end)
Replace: flower
With the layers with the following names selected
hello stone -> hello stone (no match)
stone -> flower

Find: (.+) (anything, and save it as $1, same as just leaving the field empty)
Replace: A $1 heh
With the layers with the following names selected
hello stone -> A hello stone heh
stone -> A stone heh

Find: ^(flower)( ?copy( \d)?)+ (more complex regex)
Replace: A $1, %N
With the layers with the following names selected, in that order
flower -> flower (No match - doesn't have "copy"...)
flower copy 3 -> A flower, 1 (first match)
stone flower copy 1 -> stone flower copy 1 (No mach - doesn't start with "flower")
flower copy 3 copy 5 -> A flower, 2 (second match)
flower copy 1 copy -> A flower, 3 (third match)

@leonardpauli
Copy link
Owner

So basically, just:

  • Select your layers (alternatively find them through the included Select plugin; cmd-alt-F)
  • Hit cmd-alt-R
  • Leave the first field empty (ie. hit backspace followed by tab)
  • Write my prefix $1 my suffix ($1 is the original layer name)
  • Hit enter

@alessandrodallafina
Copy link
Author

Damn it, I took a look at some of the things that you can do with RegEx but I totally missed it! #facepalm

Thanks a lot for replying so quickly! And keep it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants