php regular expression functions

Concluído Postado Sep 26, 2013 Pago na entrega
Concluído Pago na entrega

I need two regular expression functions written that will parse text and return values from the text.

REGEX 1:

I need the function to return any integer after the first occurence of "bt"

So:

$string = "bt 10 He went to the store";

echo regex1($string):

This should result in:

10

$string = "bt 65 bt 12 I am happy bt 65 bt bob";

echo regex1($string);

gives:

65

$string = "btt 23 I am lonely";

echo regex1($string);

gives

NULL

$string = "bt 5.5 I am bob";

echo regex1($string);

gives

5

REGEX 2

This function returns the first alphanumeric (case insensitive) word following the first occurence of the word "bc" that is a color in the format #XXXXXX (up to six of the following characters ABCDEF01234567890) or is contained in an array of other options.

array("red", "blue", "green", "white");

$string = "I want to go to the movies bc #FFFFFF";

echo regex2($string);

gives

#FFFFFF

array("red", "blue", "green", "white");

$string = "I want to go to the movies bc red";

echo regex2($string);

gives

red

array("red", "blue", "green", "white");

$string = "I want to go to the movies bc 1red";

echo regex2($string);

gives

null

PHP Arquitetura de software

ID do Projeto: #4968962

Sobre o projeto

8 propostas Projeto remoto Ativo em Sep 26, 2013

Concedido a:

praveen458

Hello, I am a javascript and php programmer.I have read the job description. I can do this job perfectly as per your need and available now,thanks

$15 USD em 1 dia
(13 Comentários)
3.6

8 freelancers estão ofertando em média $24 nesse trabalho

rajeshsonisl

Quality work assured. Ready to get started. Thanks.

$28 USD em 1 dia
(420 Comentários)
7.1
eComOS

Hello drowningbizman, I have read your requirements, I'm a PHP Expert Developer and I am very confident to do this project. I guarantee complete satisfaction before payment. Please check PM for more details, Thank you!

$30 USD in 0 dias
(26 Comentários)
4.2
barrima

hello, check pm

$25 USD em 1 dia
(6 Comentários)
3.3
kartikkshah

My self Kartik Shah I have over 6 years experience to work in the web technologies and software field. I have experience to Work on: Technologies: php, mysql, sql-server, LAMP, ajax, JQuery, json, javascript, xml, Mais

$21 USD in 0 dias
(6 Comentários)
3.0
creativedeepika

ready to start work.

$20 USD em 1 dia
(6 Comentários)
2.8
DevRk

I can do this task..

$30 USD in 3 dias
(1 Comentário)
0.8
khages009

Ready to start work

$25 USD em 1 dia
(1 Comentário)
0.6
ITfrankfurt

Very easy task. I've been working with regular expressions alot. I can do it right now, or tomorrow.

$20 USD em 1 dia
(1 Comentário)
0.4
husnain0111

hi i am interested in your project.i have 2 year of experience in web development

$25 USD in 3 dias
(1 Comentário)
0.0