Em Andamento

PHP-Function rewrite htmlsource

The function should take a html-source-string and replace parts of it according to the information given in a second parameter (array).

## Deliverables

This should be a easy for an experienced php-programmer.

**PHP-Version: 5.2**

The function should take a html-source-string and replace parts of it according to the information given in a second parameter (array):

The Array contains the following fields/information:

* **'searchpattern'** : a regular expression whose matches in the html-source should be replaced according to the following rules:

* **'replacepattern'**: the matching regular expression computing the replacement string - or empty if no replacement should be done

* **'link' ** : an URL the resulting pattern (or the original if 'replacepattern' is empty ) should be linked to - or nothing if empty

* **'start' ** : the # of the occurance that should be replaced (i.e. 3 => don't replace the first two occurances) - default: 1

* **'skip'** : the # of occurances that should be skipped after the first replacement (i.e. 1 - skip 1 then replace the next then skip 1 again and so on...) default: -1 (special value: only once!)

* **'casesensitive'** : if true the regular expression should be case sensitive, if false not - default: true

* **'fullwordsonly'** : if true only fullwords should be replaced, if false also parts of words should be replaced - default: true

and should the replacement string be part of another searchpattern match it should not be counted as such!

*Example: source: "*abc def ghi jkl*", first searchpattern:* def*, first replacement:* jkl*, second searchpattern:* jkl*, second replacement:* xyz*, the result should be: "*abc jkl ghi xyz*"

*

There are two more rules to obey:

* Never! replace strings within an URL (within an a-tag)

*Example: source: 'whatever <a href="[url removed, login to view]">abc</a> and some more...', searchpattern: abc, replacement: xyz, then the result should be: 'whatever <a href="[url removed, login to view]">xyz</a> and some more...'*

* Don't wrap a link around the result if it's already in a link

*Example: source: 'whatever <a href="[url removed, login to view]">abc jolly be good</a> and some more jolly ...', searchpattern: jolly, replacement: xyz, and link: [url removed, login to view] then the result should be: 'whatever <a href="[url removed, login to view]">abc xyz be good</a> and some more <a href="[url removed, login to view]">xyz</a>* ...'

Upon Agreement I will provide more testing examples (including the desired results)

Habilidades: Engenharia, MySQL, PHP, Arquitetura de software, Teste de Software

Ver mais: rewrite function php, string pattern matching in c, string pattern matching, string pattern match, string pattern, string matching in c, string match, regular expression words, regular expression or example, regular expression no, regular expression in c, regular expression function, regular expression for words, regular expression example, regular expression c, regular expression a, regular expression 0, php string to html, php function for, pattern strings, pattern string, pattern matching string, pattern matching in strings, pattern matching in string, match string

Acerca do Empregador:
( 2 comentários ) Germany

ID do Projeto: #3046132

Premiar a:

rajamanickam1000

See private message.

$25.5 USD em 16 dias
(78 Avaliações)
5.8

13 freelancers estão ofertando em média $78 para este trabalho

dancoderdan

See private message.

$85 USD in 16 dias
(57 Comentários)
6.5
Andreena

See private message.

$63.75 USD in 16 dias
(261 Comentários)
5.9
Eliteprog

See private message.

$34 USD in 16 dias
(31 Comentários)
5.6
khalidsafwatvw

See private message.

$72.25 USD in 16 dias
(64 Comentários)
5.5
edreamzinc

See private message.

$80.75 USD in 16 dias
(24 Comentários)
5.1
sumon4work

See private message.

$67.15 USD in 16 dias
(42 Comentários)
4.7
svasti

See private message.

$42.5 USD in 16 dias
(13 Comentários)
3.6
sahilsakhujavw

See private message.

$212.5 USD in 16 dias
(2 Comentários)
2.2
spiderzsolutions

See private message.

$143.65 USD in 16 dias
(1 Comentário)
2.0
masifnawaz

See private message.

$85 USD in 16 dias
(6 Comentários)
2.0
touseefphpm

See private message.

$85 USD in 16 dias
(2 Comentários)
2.0
twandreih

See private message.

$19.55 USD in 16 dias
(0 Comentários)
0.0