Page is a not externally linkable
Globetrotter - 10:21 am on Oct 5, 2012 (gmt 0)
Thanks again for the great help! I appreciate that. I should have picked my words more carefully, but what I’m trying to find is x words before and x words after a keyword where the searching for extra words should stop when html code, or the begin or end of a sentence is found based on the characters .!? (or the max number of words before or after is reached). Let’s skip bb code for now (because I could parse bbcode to html first and then search for the text).
For all examples i use these "settings"
Keyword = popular
Words before keyword = 2
Words after keyword = 8
Example text one:
“PHP is presently the most popular scripting language in use on the Internet. You are able to code almost anything with it.”
Should give: “the most popular scripting language in use on the Internet”
Example text two:
“PHP is presently the most popular scripting language in use <strong>on</strong> the Internet. You are able to code almost anything with it.”
Should give: “the most popular scripting language in use”
To make it less complex i think i need to skip the 'and " part for now. Not sure if you can do anything about it.
In your example regexin the second post where would you put the keyword? And it seems not limited to x words before and after or am i mistaken :)
For the record i'm not an regex expert. I try based on trail and error and research every option on a cheat sheet :)