hi, i'm working on a function that highlights search results. problem:
a search input like "te est"; two terms that match one word ("test").
the mysql query matches entries like this but my function isn't able to
highlight them the right way:
function highlight($src_terms, $src_terms_int, $res
Am Sonntag, 07.09.03 um 14:11 Uhr schrieb Catalin Trifu
<[EMAIL PROTECTED]>:
Here the $result is changed to 'test' on the first search.
Obviously on the second replace the term will not be found anymore!
yes, it's obvious.
like i said:
output: this is just a test
(after the first term is
Am Sonntag, 07.09.03 um 21:17 Uhr schrieb John W. Holmes:
output: this is just a test
(after the first term is highlighted the second one can't be found
anymore.)
but how to work around it??
Highlight the longest words first?
I don't think that would change anything. A search for "te est" then
h
Am Montag, 08.09.03 um 04:21 Uhr schrieb Lee O'Mara:
Why not just allow for bold tags in the search term? What I mean is, I
think you can get the results you want by allowing any number of open
or close bold tags between each letter of the search term.
i thought so too (but i had no idea how to
Regular Expressions: How can I indicate that the contents of a term
(user input*) needs to be treated as 'non-operators/control characters'
(as *word* to match in that exact way)?
(* Because the term is a user's input I can't escape the control
characters manually.)
Example:
$result =
preg_rep
regular expressions
the example below should turn any character exept "\*" (*= any char)
into an "x":
$term = preg_replace('/[^(\\\)+(.){1}]/', 'x', $term);
but i guess because of the [brackets] the "." (period) is treated as
character "." instead as metacharacter (that matches any char).
anyo
01.10.03 at 18:17 Curt Zirzow wrote:
preg_replace('/(?01.10.03 at 18:27 CPT John W. Holmes wrote:
$term = preg_replace('/[^\\]./','x',$term);
they don't work (thanks anyway)
it's pretty simple: i need a regex that matches any character in a
string except "\*" (* stands for any char that follows t
1. The PHP manual sais to escape the escape char, it has to be written
twice*, but:
$term = preg_replace('/(\\)/', 'backslash $1', $term);
causes an error** while using three backslashes (see 2.) works.
2.1.
$term = "beg \ end";
print preg_replace('/(\\\)/', 'backslash $1', $term);
returns: beg b
Am Mittwoch, 01.10.03 um 22:27 Uhr schrieb Chris W. Parker:
Seeing as how you haven't had a response yet, I'll ask this: what
exactly is your question? I'm not sure as to what it is that you want.
My question are:
a) Why does the PHP manual say that backslashes get escaped by writing
them twice wh
Am Donnerstag, 02.10.03 um 01:37 Uhr schrieb Cristian Lavaque:
doh, I now understand your question, you don't mean the asterisk
literally,
but as any character that follows a backslash... sorry -_-
that's right ;) -- anyway, thanks for your effort!
my problem was that i misunderstood the escape-t
10 matches
Mail list logo