Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with back reference

Status
Not open for further replies.

cdlaforc

Programmer
Oct 11, 2006
6
US
Hello,
I'm trying to use back references to replace the a piece of text in the middle of a string with a different number without having a space between the back reference and the number. In the code bellow backreference 3 is working, but not 1. I believe it is because it is right up against the number I want in between back reference 1 and 3.

$AIP=~s/^(AIP\|.*?\|.*?\|)(.*?)(\|.*)$/$114000589$3/;

Let me know if you can offer any help.
Thanks,

Chris.
 
Use ${1} to explicitly specify what the correct variable is to be interpolated.

- Miller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top