The following pattern (which is one subpattern in a string of several) looks
for the following
$xxx,xxx.xx (with the dollar sign)
or
xxx,xxx.xx (space in replace of missing dollar sign)
It works great WITHOUT a ? quantifier
((?:\\$|\s*)(?: \d{1,3}\,)?\d{1 ,3}\.\d{2}(?:</b>))
but fails WITH a ? quantifier
((?:\\$|\s*)(?: \d{1,3}\,)?\d{1 ,3}\.\d{2}(?:</b>))?
I need the rest of the pattern results, not matter if this subpattern exists
or not. If it doesn't exist, I need the respective array value to be empty.
What's wrong with my syntax?
Thanks.
for the following
$xxx,xxx.xx (with the dollar sign)
or
xxx,xxx.xx (space in replace of missing dollar sign)
It works great WITHOUT a ? quantifier
((?:\\$|\s*)(?: \d{1,3}\,)?\d{1 ,3}\.\d{2}(?:</b>))
but fails WITH a ? quantifier
((?:\\$|\s*)(?: \d{1,3}\,)?\d{1 ,3}\.\d{2}(?:</b>))?
I need the rest of the pattern results, not matter if this subpattern exists
or not. If it doesn't exist, I need the respective array value to be empty.
What's wrong with my syntax?
Thanks.
Comment