The regex:
[code]
# Region
s*Region:s*
(?.+?(?=))
s*
s*
s*
#Optional AD
(
s*
s*
]*?)>
(?:.+?)s*s*
){0,1}
s*
(
# Amenities
]*?)>
s*
(?:.+?)
(?.+?)
s*
){0,1}
(?:.+?)
#Extra(
s*(?.+?)s*
){0,1}
[/code]
The text to be processed:
[code]
Drive
Front
Transm
Mech
Intr
Leather
COND/td>
USED
Region/td>
QQQQQQQQQQQQQ
Extra info
Good condition. Assembled in ---------
[/code]
Why doesn't it return me "Good condition. Assembled in ---------" for "Extra" group? This group is actually optional; that's why I marked it with {0,1}. And if I remove {0,1} the regex returns me it's expected value but only in this particular case.
What's wrong to my regex?