Detect string patterns with regular expressions
$250-750 USD
货到付款
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()
项目ID: #6586850
关于项目
授予:
Hi, I have one question, do yo need this done just with regexp, or some js logic can also be used? Thanks. Sergio.
有10名威客正在参与此工作的竞标,均价$540/小时
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
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 更多
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..
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..
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 更多
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 更多