datarecall 0 Posted January 17, 2011 Report Share Posted January 17, 2011 I have some text here : http://xxxx.net/fire.php?eid=5&ofid=24&varme=1-16210 and I am trying to extract using find regular expression using this : http://dl.dropbox.com/u/2397195/sshot-16.png but its returning the entire line back for some reason. Quote Link to post Share on other sites
MiriamMB 63 Posted January 17, 2011 Report Share Posted January 17, 2011 I have some text here : http://xxxx.net/fire.php?eid=5&ofid=24&varme=1-16210 and I am trying to extract using find regular expression using this : http://dl.dropbox.com/u/2397195/sshot-16.png but its returning the entire line back for some reason. Try this website: http://rubular.com/ It can help you creak down the regular expression you are using, line by line, so that you can figure out what is matching and what is causing the issues. Quote Link to post Share on other sites
Frank 177 Posted January 17, 2011 Report Share Posted January 17, 2011 Your regex line is faulty. The '.' right in the beginning is telling the regex statement to grab the whole line. Acutally it's saying grab anything but a new line character. Doesn't matter what follows it. Frank Quote Link to post Share on other sites
datarecall 0 Posted January 17, 2011 Author Report Share Posted January 17, 2011 the . matches any character with the + giving back as needed so it matches up to the varname, unless im mistaken and php is different then js regex. Quote Link to post Share on other sites
Frank 177 Posted January 18, 2011 Report Share Posted January 18, 2011 Yes, you are not correct. The '.' states to match any character with the exception of the new line character. The '+' right after it states to match 1 or more of the previous sequence, which is the '.'. If you wish to filter from left to right, put a '^' in the very front. This states that you are telling the regex statement to start matching from the front of the line. If you want to get a better handle on regex, then head over to this thread here: http://ubotstudio.com/forum/index.php?/topic/5919-seth-ive-got-to-say/ You'll find a video link there that talks about regex. Frank Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.