If it is for WoW, check out this strsplit function.
Otherwise, you can do this using string.find or string.match and templates . It can be as simple as making string.match for %d+ to find the first number in a string, as shown below:
number = string.match( "Need Roll - 150 for [SomeItem] by [SomePerson] + role bonus", "%d+" )
source share