Re: [PHP] (another) regex difficulty

2003-10-02 Thread jonas_weber
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

Re: [PHP] regex drive me crazy

2003-10-01 Thread jonas_weber
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

[PHP] regex drive me crazy

2003-10-01 Thread jonas_weber
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

Re: [PHP] (another) regex difficulty

2003-10-01 Thread jonas_weber
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

[PHP] (another) regex difficulty

2003-10-01 Thread jonas_weber
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

[PHP] regex/preg_replace() difficulty

2003-10-01 Thread jonas_weber
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

[PHP] Re: highlighting multi term search results

2003-09-08 Thread jonas_weber
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

[PHP] Re: highlighting multi term search results

2003-09-07 Thread jonas_weber
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

[PHP] Re: highlighting multi term search results

2003-09-07 Thread jonas_weber
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

[PHP] highlighting multi term search results

2003-09-07 Thread jonas_weber
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