PHP: preg_match() not correct
问题 I have the following string: <w:pPr> <w:spacing w:line="240" w:lineRule="exact"/> <w:ind w:left="1890" w:firstLine="360"/> <w:rPr> <w:b/> <w:color w:val="00000A"/> <w:sz w:val="24"/> </w:rPr> </w:pPr> and I am trying to parse the "w:sz w:val" value using preg_match(). So far, I've tried: preg_match('/<w:sz w:val="(\d)"/', $p, $fonts); but this has not worked, and I'm unsure why? Any Ideas? Thank you in advance! 回答1: You were trying to capture only single-digit numbers. Try adding a + to make