Project Detail

Easy RegEx for PHP JavaScript  

Easy RegEx for PHP JavaScript is project number 473940
posted at Freelancer.com. Click here to post your own project.

 

| More Free Trial For New Buyers
 

Status:

Selected Providers: deOne

Budget: $30-250

Created: 07/22/2009 at 13:27 EDT

Bid Count: 19

Average Bid:
$ 117

08/01/2009 at 13:27 EDT

Project Creator: ablime
Employer Rating: 10/1010/1010/1010/1010/1010/1010/1010/1010/1010/10 (1 reviews)

Bid On This Project
 

Description

1. We need a regular expression to split the html content into multiple pages (for pagination) and store them in PHP array. (please check the html example bellow)
The end of the "page" is described with the following tag: <hr class=”some-pagebreak” />

The RegEx should find this tags and return the HTML "page sections" into a PHP array.

2. Regular expression to extract a section of text from a tag. The Regexes is needed in Javascript and PHP.
This is the sample scenario where we require the Regex to work:
Javascript:
- Function to wrap selected html in the following tag: ‘<span class=”pragma-teaser”>’ and ‘</span>’. Please check the html example bellow.
- CONDITION: There should be only one paragraph that is embedded in the above mentioned span tag . We need another Regex function that will search for an instance of this tag and if it finds it it should remove it from that paragraph an apply it to the selected html.

- We also need Regex for stripping the ‘<span class=”pragma-teaser”>’ and ‘</span>’ tags if we want to remove teaser. So we need another RegEx that will remove this tag and leave the inner HTML untouched.
- PHP:
Extract the html content contained in ‘<p class=”pragma-teaser”>’ and ‘</p>’ for
Remove ‘<p class=”pragma-teaser”>’ and ‘</p>’ when displaying the full article



html EXAMPLE



var html = '<h2><span class="editsection">[<a href="/w/index.php?title=Jedi&amp;action=edit&amp;section=5" title="Edit section: Equipment">edit</a>]</span> <span class="mw-headline">Equipment</span></h2>
<div class="rellink boilerplate seealso">See also: <a href="/wiki/Lightsaber" title="Lightsaber">Lightsaber</a></div>
<p>Within the Star Wars universe, the Jedi are usually portrayed as dressed in simple robes and carrying specialized field gear for their missions. The most notable instrument wielded by a Jedi is the <a href="/wiki/Lightsaber" title="Lightsaber">lightsaber</a>.</p>
<p>Lightsabers are used by both Jedi and Sith. Jedi commonly wield blue and green lightsabers in the movies, while the Sith tend to wield red ones. Jedi <a href="/wiki/Mace_Windu" title="Mace Windu">Mace Windu</a> (<a href="/wiki/Samuel_L._Jackson" title="Samuel L. Jackson">Samuel L. Jackson</a>) and Siri Tachi (from Expanded Universe books) wield unique purple lightsabers. Master Yaddle was known to wield an orange lightsaber. The former Jedi Padawan Ferus Olin, from Expanded Universe books, wielded a red blade. However, he was not a <a href="/wiki/Sith" title="Sith">Sith</a>.</p>
<p>In the Expanded Universe of Star Wars media, there were a vast variety of lightsaber colors. In <i><a href="/wiki/Star_Wars:_Knights_of_the_Old_Republic" title="Star Wars: Knights of the Old Republic">Knights of the Old Republic</a></i> video game, the colors signified the Jedi's specialization.</p>
<p><br /></p>’;

var text = ‘Within the Star Wars universe, the Jedi are usually portrayed as dressed in simple robes and carrying specialized field gear for their missions. The most notable instrument wielded by a Jedi is the <a href="/wiki/Lightsaber" title="Lightsaber">lightsaber</a>.';

After replace:
html = '<h2><span class="editsection">[<a href="/w/index.php?title=Jedi&amp;action=edit&amp;section=5" title="Edit section: Equipment">edit</a>]</span> <span class="mw-headline">Equipment</span></h2>
<div class="rellink boilerplate seealso">See also: <a href="/wiki/Lightsaber" title="Lightsaber">Lightsaber</a></div>
<p><span class=”pragma-meta”>Within the Star Wars universe, the Jedi are usually portrayed as dressed in simple robes and carrying specialized field gear for their missions. The most notable instrument wielded by a Jedi is the <a href="/wiki/Lightsaber" title="Lightsaber">lightsaber</a>.</span></p>
<p>Lightsabers are used by both Jedi and Sith. Jedi commonly wield blue and green lightsabers in the movies, while the Sith tend to wield red ones. Jedi <a href="/wiki/Mace_Windu" title="Mace Windu">Mace Windu</a> (<a href="/wiki/Samuel_L._Jackson" title="Samuel L. Jackson">Samuel L. Jackson</a>) and Siri Tachi (from Expanded Universe books) wield unique purple lightsabers. Master Yaddle was known to wield an orange lightsaber. The former Jedi Padawan Ferus Olin, from Expanded Universe books, wielded a red blade. However, he was not a <a href="/wiki/Sith" title="Sith">Sith</a>.</p>
<p>In the Expanded Universe of Star Wars media, there were a vast variety of lightsaber colors. In <i><a href="/wiki/Star_Wars:_Knights_of_the_Old_Republic" title="Star Wars: Knights of the Old Republic">Knights of the Old Republic</a></i> video game, the colors signified the Jedi's specialization.</p>
<p><br /></p>’;

Messages Posted:0 View project clarification board Post message on project clarification board

Bid On This Project
 

If you are the project creator or one of the bidders Log In for more options

 

211

4 days

07-22-2009 13:51 EDT

Please view PM to discuss ahead towards start.

help

 

200

3 days

07-22-2009 13:33 EDT

I am ready to do this for you

help

 

75

2 days

07-22-2009 14:08 EDT

I can do this work. Thanks, Suresh

help

 

180

0 days

07-22-2009 13:59 EDT

I can do usch regexp easily. Please contact.

help

 

125

3 days

07-22-2009 19:10 EDT

Please check the PMB.

help

 

190

3 days

07-22-2009 13:51 EDT

Hello sir, i can start work on this project from now. please check PMB. thanks.

help

 

100

0 days

07-22-2009 15:16 EDT

Dear Customer! I am very experienced with regexp's. Please see PMB for examples of my previous work related to this field. Ready to start right now and finish within several hours. My bid is for fast professional service exciting my customers. Please contact in PMB if you have any questions. Best Regards, Zeke

help

 

200

0 days

07-22-2009 14:41 EDT

We can do this thanks.

help

 

30

1 day

07-22-2009 15:22 EDT

I use regex very often. Will be glad to help you.

help

 

50

1 day

07-22-2009 14:13 EDT

hello , please check pm

help

 

150

1 day

07-22-2009 21:26 EDT

Hi, please check your mesasge box for some clearences. Regards, DrTech76

help

 

70

1 day

07-22-2009 14:12 EDT

Hi there, please check your PMB

help

 

80

0 days

07-22-2009 15:22 EDT

would be happy to do this today for you

help

 

50

1 day

07-22-2009 16:41 EDT

I'd be glad to take care of this for you, please see pm

help

 

30

0 days

07-22-2009 14:16 EDT

It is so very easy task.

help

 

200

5 days

07-23-2009 04:29 EDT

let me start, thanks, have a nice day, plz check your private message.

help

 

75

1 day

07-22-2009 16:06 EDT

I have a lot of experience with Regular expressions as well as PHP and Javascript. I can knock this project out for you in 1 day no problem.

help

 

100

1 day

07-22-2009 19:03 EDT

(No Feedback Yet)

I can do it with my strong experience in Regex. I have done 2 website already which are using Regex to extract data. Contact if interested.

help

 

100

2 days

07-22-2009 19:48 EDT

(No Feedback Yet)

Hi,I am interested ...please check PMB -Paayal

help


    Bid on this Project