Find Jobs
Hire Freelancers

A PCRE in PHP

$5-10 USD

Terminado
Publicado hace alrededor de 21 años

$5-10 USD

Pagado a la entrega
Easy one for those who know regex's well! If I have a big long string that basically contains a messy HTML page, I want to strip out: 1: All HTML comments 2: All javascript comments 3: All whitespace than can be removed .. without breaking anything. It sounds easy enough, but there's some odd quirks that make it more challenging than I want to handle :) See the full spec for the way I see it... Cheers, C ## Deliverables Easy one for those who know regex's well! If I have a big long string that basically contains a messy HTML page, I want to strip out: 1: All HTML comments 2: All javascript comments 3: All whitespace than can be removed Here's the HTML comments regex: preg_replace('/;/', '', $buffer); Problem 1: If you follow that and you know HTML, you'll know that it's great unless you're inside a tag pair that uses comments to protect its content from older browser that don't understand (most common I guess being {script} and {style} tags. Problem 2: Javascript comments that might appear after a line of code, not on their own - eg: var problemVar; // this variable is commented Problem 3: Whitespace that appears inside {pre} tags needs to remain untouched (I don't know if there's any others like that). Those are the problems that I can think of, there might be more - notice the brief says "without breaking anything"! :) Nice regex problems if anyone fancies them anyway :) 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Complete ownership and distribution copyrights to all work purchased. ## Platform PHP / Linux / use PCRE's, not PHP's own regex stuff
ID del proyecto: 2895347

Información sobre el proyecto

2 propuestas
Proyecto remoto
Activo hace 21 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
See private message.
$7 USD en 14 días
5,0 (7 comentarios)
2,1
2,1
2 freelancers están ofertando un promedio de $7 USD por este trabajo
Avatar del usuario
See private message.
$7,65 USD en 14 días
4,9 (27 comentarios)
4,6
4,6

Sobre este cliente

Bandera de UNITED KINGDOM
United Kingdom
5,0
65
Miembro desde dic 11, 2002

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.