Help - Search - Members - Calendar
Full Version: Regexp Help
Zymic Webmaster Forums > Web Design & Development > General Web Design Discussion
PodTube
So, let's say I have to have this regular expression that detects when the characters "poo " are at the beginning of a line of text. Then, I want the remaining text to be encircled with () to let me pull it with $1. This ends whenever \n is found. How would I do this? I was thinking:
CODE
poo (.*)\n

But wouldn't that select everything, because \n fits into the . wildcard? Please help.
Brandon
\n doesnt fit into the . if you want set it to with a switch
PodTube
And how would I do that?
swordz
Try:
CODE
poo([^\n]*)\n

The ^ means match anything but.

swordz
C_Teacher
it canny looks like u writing in C if im not mistaken with the \n
swordz
\n is a standard line break in a few languages.

swordz
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.