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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need a function that uses regexp to change slashes in html <a> tag

Status
Not open for further replies.

justride

Programmer
Jan 9, 2004
251
US
Hi,

Is it possible to read a directory of sub directories and various folders to read in htm files only, scan through them and use regexpression to make all back slashes forward slashes for all hyperlinks that fall within the <a> tag?

I tried doing this is EditPad pro, but I cant seem to get it to work.

Does anybody know what the function would look like or if there is an easier way?

Thanks
 
Use perl, it is better for string manipulation and regex. Forum219

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Yes, it is possible.
The pseudo-op code would be like:

1. Read the directory, find .htm files and subfolders.
2. open .htm file using file_get_contents
3. run regex
4. save file (make a backup ;))
5. next file or descend to next folder

It's not just easy, so consider an alternate solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top