Selection by regular expression.

Hey!

I need help for script writting , I'm bad at scripting and I need a simple script.

This script is selecting all the mesh have the suffix "_2"

Just this ...

Sorry for my bad english :)

Thanks for your help :)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kasimashi's picture

---

---

Kasimashi's picture

--

--

barigazy's picture

try this one

select (for o in objects where matchPattern o.name pattern:"*_2*" collect o)

barigazy

barigazy's picture

about patterns

If you use "*_2" as pattern then you will be able to select all objects with
name where last two characters matching pattern like "Mash_2", "Box_2" etc.
But if you use "*_2*" then you can select also "Mash_200", "Mash_25", "Mash_20_18".

barigazy

Kasimashi's picture

Reply

Don't work :(

barigazy's picture

:)

Then post at least your list of object names to see with what you playing

barigazy

Kasimashi's picture

Thanks for your help :

Thanks for your help : (object selecting with Advanced search tool )

http://img15.hostingpics.net/pics/123202names.png

And what I try :

http://img15.hostingpics.net/pics/288260whatItry.png (==> Tool ==> Evaluate tools )

barigazy's picture

:)

Man you are using "2_" not "_2". Just change pattern, also there is a group

barigazy

Kasimashi's picture

Stupid error :)

Yeah !!!!! :p It works ! Stupid error sorry :p

Thanks you for your help barigazy !!!!! :)

Have a nice day !

Regards,

Kasimashi

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.