ambantin
asked on
Simple code needed for Dreamweaver Regular Expression
I have several pages where I am using php and I need to find and replace
"$comp",$num+1,".php"
with
"$comp"
However, the +1 in the original is +1 to +32 in the pages
I need someone to reply with the code I need to do this..
"$comp",$num+1,".php"
with
"$comp"
However, the +1 in the original is +1 to +32 in the pages
I need someone to reply with the code I need to do this..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
here is another example
"$comp",$num+1,".php"
"$comp",$num+1,".php"
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
still not working... ugh
Is this for the Find/Replace dialog, or for ReReplace function?
ASKER
Find Replace - Dreamweaver MX
I think I told you a white lie... because I misread your original example. In gardavis' example, leave the quotes, but try replacing the "\d{1,2}" with a literal "1".
i.e.
i.e.
"\$comp",\$num\+1,"\.php"
To account for the "+32", try using:
"\$comp",\$num\+[0-9]+,"\.php"
ASKER
still not found in current document....
ASKER
here is a sample of the code I am using
it is the comp line that needs to be changed in every page... 76 entries
it is the comp line that needs to be changed in every page... 76 entries
</tr>
<tr>
<td height="134" align="center" valign="middle"> </td>
<td align="center" valign="middle"> <h2><a href="<?php echo "$socstud",$num,".php"; ?>">Social
Stud</a><br />
<a href="<?php echo "$whist",$num,".php"; ?>">World
Hist</a><br />
<a href="<?php echo "$lgsocstud",$num,".php"; ?>"><font color="#00FF00">Social
Stud</font></a><br />
<a href="<?php echo "$comp",$num,".php"; ?>">Computer</a><br />
<a href="<?php echo "$math",$num,".php"; ?>">Math</a><br />
<a href="<?php echo "$science",$num,".php"; ?>">Science</a><br />
</h2></td>
<td align="center" valign="middle"> <h2><a href="<?php echo "$rel",$num+1,".php"; ?>">Religion</a><br />
<a href="<?php echo "$lgsocstud",$num+1,".php"; ?>"><font color="#00FF00">Social
Stud</font></a><br />
<a href="<?php echo "$comp",$num+1,".php"; ?>">Computer</a><br />
<a href="<?php echo "$biology",$num+1,".php"; ?>">Biology</a><br />
<a href="<?php echo "$science",$num+1,".php"; ?>">Science</a><br />
<a href="<?php echo "$health",$num+1,".php"; ?>">Health</a><br />
</h2></td>
Silly question (which assumes I'm looking at an applicable version in the screenshot I reviewed): Do you have the "Use Regular Expressions" box checked?
ASKER
yes i do
ASKER
Has anyone got it to work?
Does DreamWeaver regular expressions work the same as others? My example at the top is based on ASP.Net but there is nothing really unusual or non-portable in what I described.
Ambantin, how do you call the regex? Can you show your code?
Gary
Ambantin, how do you call the regex? Can you show your code?
Gary
ASKER
Dreamweaver is menu driven
000000.jpg
000000.jpg
ASKER
I have CS3 at the school... at home I only have MX... It worked with CS3 but not MX...
ASKER
Doesn't work with macromedia dreamweaver mx
ASKER