Will it always be Message before the open bracket? if so:
(?<=Message\()'[^.]+
if not:
^.*?('[^']+')
and the first capture group, see here.
EDIT: for the whole message:
^.*?('[^.]*.')
See here for example.
Question
I'm trying to extract messages from following type of strings,
Error_Message('The value 1,2 and 3 that you have entered is invalid.');
using the following regular expression,
\s*(\w+):\s*(?:'\s*(?:\|\S*)'\s*|[^'])+
'
But the problem is that this fails in certain scenarios such as,
General_Message('Sample message value :p you have '||CHAR(10)||'entered is invalid.', FunctionY('xyz', param2) );
General_Message(' The percent may not be negative.',FunctionZ('xyz', parameter2));
Need support from you guys to fix this.
Thanks in advance!
OTHER TIPS