bluewalrus
01-10-2009, 03:28 PM
I want you use regular expressions to find 1. a new line / entered line and 2. to find a website. When using them is there a find and replace or does it write it to a varible that then would be used with the string_replace?
1. This is an example of what I'd like to find. The * indicates where I'd expect the match to occur. I've found "\n \t \r". I don't know if \n would be both of those or just the second and where \r would work. Would I put 2 in two find the second or 2\n or 2\r? I want to be able differentiate from each.
"This is the test
*this was one return.
*
This is two returns."
2. I'd assume i'd start the search with http:// then the regex for anything (forgot what that is *?) but I can't figure out how to find the end of the address like i figured I could do a long list of if's with all extensions and then domain endings with/ and a space like ".com/ " but is there any easier way?
*indicate what I'd want to find.
*http://www.google.com/*
*http://www.google.com/yeah.html*
Thanks for any suggestions you can offer.
1. This is an example of what I'd like to find. The * indicates where I'd expect the match to occur. I've found "\n \t \r". I don't know if \n would be both of those or just the second and where \r would work. Would I put 2 in two find the second or 2\n or 2\r? I want to be able differentiate from each.
"This is the test
*this was one return.
*
This is two returns."
2. I'd assume i'd start the search with http:// then the regex for anything (forgot what that is *?) but I can't figure out how to find the end of the address like i figured I could do a long list of if's with all extensions and then domain endings with/ and a space like ".com/ " but is there any easier way?
*indicate what I'd want to find.
*http://www.google.com/*
*http://www.google.com/yeah.html*
Thanks for any suggestions you can offer.