[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: XPL questions



Okay, here's an example of my wildcard problems.

In preparing an HTML file from a text file, I want to change various
special characters, such as the number sign (#), to their html equivalents
(#)


But the text has URLs in it, and I want to leave its characters as is. My
solution is to "hide" the URLs inside a label. Then do a general CI for
changing the characters in the rest of the text. The text always has URLs
on a line by themselves, so I thought I would just do a CI of this form
(for email clarity I'm putting the find and the replace on separate
lines--of course I don't use this in the actual XPL):


Find: {CR}http://{W}{W}{W}{W}{CR}
Repl: {CR}≪LBhttp://{W}{W}{W}{W}{CR}

Note: I have the left and right guillemets stored in S/Gs which appear on
the command line as ≪PV595≫ and ≪PV596≫ respectively. This isn't the
issue, because I've tried doing it manually from the command line.


I use four wild-string Ws because URLs can be quite long--this gives me 320
characters as an length limit before the carriage-return-line-feed (which,
incidentally, is the "tame" "anchor" for it).


But this gives the error: "Wildcards must be in the same order on both
sides of a change." Carl has noted that this error message is somewhat
"delphic."


My test URL is:

http://www.citgo.com¯/AboutCITGO.jsp

I could get the thing to work if I used only one {W}.
I also got it to work with two, if I separated them by a period (since
there always is one in any URL).


Of course, the simple workaround is to use a loop to search for each URL
and then put in the "≪LB" and then the closing "≫"--but that's so inelegant.


Harry Binswanger
hb@xxxxxxxx