I have some string like this one:
DEV_NUM_26 - Some type...TYPE0 with support of some functions
My target is to get next data: (id=26, type=TYPE0)
Expression is looks like this:
(?<id>(?<=DEV_NUM_) \d{0,3}) \s-\s (?<name>(?<=Some \s type \.+) \w+)
but I got 0 match results and the problem is in second (?<=). If I try to make something like:
(?<id>(?<=DEV_NUM_) \d{0,3}) \s-\s (?<name>Some \s type \.+ \w+)
I got next result: (id=26, type=Some type...TYPE0).
The first and main question is how to fix this expression) And last but not least is why excluding prefix (?<=) doesn't work at the end of expression? As I understand, it suppose to find a part of expression in brackets and ignore it, like in the first part of expression, but it doesn't...
(?<id>(?<=DEV_NUM_) \d{0,3}) \s-\s Some\stype\.+(?<name>(?<=Some \s type \.+) \w+)would work (but so verbose!), as would(?<id>(?<=DEV_NUM_) \d{0,3}) \s-\s [\w\d\s\.]+(?<name>(?<=Some \s type \.+) \w+)(less verbose, but still not as clean as hwnd's answer below).