Detect string patterns with regular expressions

Completado Publicado Oct 13, 2014 Pagado a la entrega
Completado Pagado a la entrega

I have a series of text patterns that need to be identified in a block of text. The routine will be in Javascript and will return an array identifying the patterns matching according to the specs below.

The text will have linefeeds. I need the line number, the ids, and the type of pattern matched.

Important: Any pattern containing [[...]] should be discarded. That is "[[" followed by any number of characters then "]]"

In the patterns below the identifiers are represented by aaa or bbb is an id. An id can be in the range A-Za-z0-9_ There may be more than 1 identifier in a string.

The pattern has the type specified.

Type: Participant

Length: 1 line

Expected output:

{type: 'Participant', pos: {start: y, stop: y}, ids: [aaa]}

Example:

participant aaa

Type: Message

Length: 1 line

Expected output:

{type: 'Message', pos: {start: y, stop: y}, ids: [aaa, bbb]}

Example:

aaa -> bbb

Type: MessageWithText

Length: 1 line

Expected output:

{type: 'MessageWithText', pos: {start: y, stop: y}, ids: [aaa, bbb]}

Example:

aaa -> bbb : text

Type: Reference

Length: 1 line

Expected output:

{type: 'Reference', pos: {start: y, stop: y}, ids: [aaa, bbb]}

Example:

ref over aaa, bbb

Type: ReferenceWithText

Length: 1 line

Expected output:

{type: 'ReferenceWithText', pos: {start: y, stop: y}, ids: [aaa, bbb]}

Example:

ref over aaa, bbb : text

Type: MultiLineReferenceWithText

Length: multiple lines

Expected output:

{type: 'MultiLineReferenceWithText', pos: {start: y1, stop: y2}, ids: [aaa, bbb]}

Example:

ref over aaa, bbb

multiple lines of text with no [[...]]

end

Type: MultiLineNote

Length: multiple lines

Expected output:

{type: 'MultiLineNote', pos: {start: y1, stop: y2}, ids: [aaa] }

Example:

note left of aaa {

multiple lines of text with no [[...]]

}

note right of aaa {

multiple lines of text with no [[...]]

}

Type: Class

Length: single line

Expected output:

{type: 'Class', pos: {start: y, stop: y}, ids: [aaa] }

Example:

class aaa

Type: ComplexClass

Length: multiple lines

Expected output:

{type: 'ComplexClass', pos: {start: y, stop: y}, ids: [aaa] }

Example:

class aaa {

Zero or more method strings (see below)

}

Type: Method

A method must be embedded into a ComplexClass

Length: single line

Expected output:

{type: 'Method', pos: {start: y, stop: y}, ids: [aaa] }

Example:

+ aaa()

PHP Arquitectura de software

Nº del proyecto: #6586850

Sobre el proyecto

10 propuestas Proyecto remoto Activo Oct 14, 2014

Adjudicado a:

sergioes

Hi, I have one question, do yo need this done just with regexp, or some js logic can also be used? Thanks. Sergio.

$250 USD en 10 días
(245 comentarios)
7.0

10 freelancers están ofertando un promedio de $540 por este trabajo

rinsadsl

Hi Good Day I am quite good with pattern matching. Have done plenty of tasks in this area. I can handle your project and all the scenarios listed without an issue. Looking forward to hear from you. Thanks Rinsad

$368 USD en 3 días
(413 comentarios)
7.6
CodingExpertz

Hi, I looked your posting and I am very much interested to work with you ...I am an India based software professional providing a range of IT services and solutions that address the technology needs of your company in Más

$789 USD en 10 días
(112 comentarios)
6.3
techwelfare

hi we could do it perfectly with accuracy, please let us know if you want to clarify in details.. if you want us to share our skill and previous work please initiate the chat by replying..

$595 USD en 10 días
(76 comentarios)
6.3
samitalways4u

Hello Sir, I have read your requirements and I am ready to do your projects and we are really confident that we are able to do it. Please Give me a Chance. Thank You..

$631 USD en 15 días
(29 comentarios)
5.7
ForeignTree

A proposal has not yet been provided

$250 USD en 4 días
(9 comentarios)
4.9
anshangtai

A proposal has not yet been provided

$555 USD en 10 días
(4 comentarios)
4.0
HDragon131

Hi Dear! I am a Expert of skills such as php, mysql, javascript and web site management. Also i have a lot of experience with these skill. I am familiar with the functions you mention in the description.I am ver Más

$526 USD en 3 días
(9 comentarios)
3.9
GabrielSoare

Propunerea nu a fost încă furnizată

$966 USD en 21 días
(6 comentarios)
3.5
jingguo811

Hi sir. Thank you for your post. I read your description carefully. I am very interesting in your assignment. I am an expert in matlab, while a manager of website development with 3 developers. They have gained en Más

$250 USD en 6 días
(3 comentarios)
2.8