excluding letters from a single string containing numbers

Apr 30, 2013 at 9:44pm

excluding letters from a single string containing numbers

is it possible to take a message “region1.001″ and exclude the “region” part of it so i can process just the number thats part of the message.

it HAS to be one string “region1.001″, not “region 1.001″

#68029
Apr 30, 2013 at 10:47pm

actually, how would i take something like “regionx/y” and take out only the x or y values seperately, so if its “region15/65″ it say, goes to unpack or whatever, and sends out 15 one outlet and 65 the other outlet.

#244438
Apr 30, 2013 at 10:48pm

i think it has something to do with the [regexp] object, but im struggling to figure it out

#244439
Apr 30, 2013 at 11:01pm

Here are some solutions:

– Pasted Max Patch, click to expand. –
#244440
Apr 30, 2013 at 11:27pm

thank you very much.
by the way. how do i actually find real in depth explanations of objects like that. it seems that some objects like [regexp] and [sprintf] arent fully explained wherever i try to look.

#244441
Apr 30, 2013 at 11:51pm

regular expressions (regexp) is a pretty deep topic. You might look here: http://perldoc.perl.org/perlre.html There are whole books on that topic. Similarly, sprintf is a standard C function: http://www.tutorialspoint.com/c_standard_library/c_function_sprintf.htm

There’s no way you’d know either of these things, though. Perhaps the help files should have links.

#244442
May 1, 2013 at 12:04am

thanks

#244443
May 1, 2013 at 12:50pm

I like the regular expression documentation that is part of Textwrangler/BBedit user manual. And of course Mastering regular expression’s book which wouldn’t really fit in regexp help file ;-)

#244444

You must be logged in to reply to this topic.