regular expressions? – perl?

Hello ^_^
I wanna match a url with a file which content black list words
means I wanna program a simple web application firewall
but i am asking
how i can match each word in the txt file with the URL using regularx expressions?

I programmed the webserver
and now i have the variables which get the URL named $request; so any idea? please I need this help :S


Related Blogs

Perl Regular Expressions Help…?

I’d like to save all values between "LON" and "TIME" into variables. The problem is I’d like to save each value to its own variable.

For example, if I have "LAT…LON 4435 9351 4821 9238 TIME" I’d like to have $lat1 = 4435, $lon1 = 9351, $lat2 = 4821, $lon2 = 9238, etc.

Can anyone offer any help on how I could construct this regular expression? It is all being read from a file called file.txt as follows:

open(FILEHANDLE, "file.txt");
@text = <FILEHANDLE>

Thank you!


Related Blogs

\d & \w IN PERL Regular Expressions?

I am trying to match a pattern such as: llmci0705171.dat. I have the following regular expression: /llmci\d+\.dat/ but this does not work. However, this pattern does work: /llmci\w+\.dat/.

This seems to hold true on win system I am developing this for and on my home linux system (where I am testing the expression w/egrep looking through files e.g. egrep -e "llmci\d|\.dat" *)

Thanks!


Related Blogs

Regular expression help?

Perl regular expression help

I want to match the string HOSTNAME except if it is followed by an equals sign.

For example in the string:

HOSTNAME=HOSTNAME

It should match the final word hostname but not the first one because it is followed by an equals sign
No Im not trying to isolate the hostname

Im looking for a regular expression which matches what I asked previously.

That is a regexp which will match HOSTNAME but not HOSTNAME=


Related Blogs

Perl regular expressions, can you help?

say i created a perl regular expression to capture any URL on the net. Then i save that file with .pl extension. Then i upload it to a directory in a web hosting company’s account as part of my perl-based web page.

is that it? as soon as i run the file, it starts collecting?

thanks
Eskwayrd – thank you very much indeed. How wonderful you have imagined every possible situation for what I could have used Perl RegExs.

As a matter of fact, i have just finished a course in Perl, I was exposed to regular expressions, and was fascinated by the idea. I asked the instructor if i could use expressions for collecting things from the web but he did not answer my question. I did not insist in case he did not have the answer :-)

This paragraph in particular helped my understanding:

"If you were expecting your script to visit other web sites and try to match URLs, then you’d need to do something to make it scan the internet, such as give it a starting page, and write the code to scan for all the URLs on that page and follow them. This is called spidering."

Spidering, that’s the missing link then. Let me do a bit of online research.

Thanks also for the link to the forum, i may well need that.

Thanks a lot.


Related Blogs

legitimate work from home jobs | Event Planning Bay Area | rent video games | Homeloans | Plumbing Courses in Manchester | increase fertility | Green Drink | Photo Keyring | Vitamin D Deficiency Symptoms | skip bags | Order Fulfillment Software | virtual receptionist | Educators Credit | bodybuilding workouts | window cleaning
Poker Software