- 論壇徽章:
- 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的子集,我現(xiàn)在是想在$cd字符串前后加上兩個(gè)標(biāo)記的字符串text:bookmark text:name="__RefNumPara__80266_$booknum"/>和<text:bookmark-end text:name="__RefNumPara__80266_$booknum"/>,這是一段xml的代碼,很亂的。程序運(yùn)行之后發(fā)現(xiàn)$ab的值沒有改變,求高手分析下。。 |
|