- 论坛徽章:
- 0
|
本帖最后由 feiying00917 于 2014-08-11 21:40 编辑
$booknum=1;
$ab='<text:p text:style-name="P332"><text:bookmark-start text:name="__DdeLink__4543_1635711675"/><text:span text:style-name="Teletype"><text:span text:style-name="T161">On schematic page 4, the ground pins GND (8) and THRM_PAD (29) of instances </text:span></text:span><text:bookmark-start text:name="__DdeLink__4522_16357116751"/><text:span text:style-name="Teletype"><text:span text:style-name="T161">U4 (MAXIM – MAX31790)</text:span></text:span><text:bookmark-end text:name="__DdeLink__4543_1635711675"/><text:bookmark-end text:name="__DdeLink__4522_16357116751"/><text:span text:style-name="Teletype"><text:span text:style-name="T161"> are not connected to ground currently. <text:s/>Recommend connecting these two pins to the ground. <text:s/>(Major)</text:span></text:span></text:p>';
$cd='<text:bookmark-start text:name="__DdeLink__4543_1635711675"/><text:span text:style-name="Teletype"><text:span text:style-name="T161">On schematic page 4, the ground pins GND (8) and THRM_PAD (29) of instances </text:span></text:span><text:bookmark-start text:name="__DdeLink__4522_16357116751"/><text:span text:style-name="Teletype"><text:span text:style-name="T161">U4 (MAXIM – MAX31790)</text:span></text:span><text:bookmark-end text:name="__DdeLink__4543_1635711675"/><text:bookmark-end text:name="__DdeLink__4522_16357116751"/><text:span text:style-name="Teletype"><text:span text:style-name="T161"> are not connected to ground currently. <text:s/>Recommend connecting these two pins to the ground. <text:s/>(Major)</text:span></text:span>';
$ab=~s/($cd)/<text:bookmark text:name=\"__RefNumPara__80266_$booknum\"\/>$1<text:bookmark-end text:name=\"__RefNumPara__80266_$booknum\"\/>/;
print $ab;
$cd是$ab的子集,我现在是想在$cd字符串前后加上两个标记的字符串text:bookmark text:name="__RefNumPara__80266_$booknum"/>和<text:bookmark-end text:name="__RefNumPara__80266_$booknum"/>,这是一段xml的代码,很乱的。程序运行之后发现$ab的值没有改变,求高手分析下!!! |
|