I have these strings:
int name
const int level
const char * const format
(float) int promenna
(char *) int jina
How can I separete in perl that name of variables (name, level, format, …) from rest? I tried some regular expresion as /((\.*\s*\w+)+)(\s+)(\w+)$/ but I am not very good at that and I have problem with my. So do anyone has easy solution? And in third example there are many spaces and you must count with that, there could be \s*. Thank you
Edit: I bad explain what I want. I said I want separate name and I mean I need remove last word (variable name) from string. I am sorry for misunderstanding.
Just substitute the last ‘word’ for nothing, using
eg:
results in