I am trying to write a regular expression but I can’t pass the words space
I have a data file like this (generated by another utility)
* field : 100
blahbla : <Set>
scree : <what>
.Cont.asasd :
Othreaol : Value, Other value
Point->IP : 0.0.0.0 Port 5060
The pattern has to match and capture data like this
"field" "100"
"blahbla" "<Set>"
"scree" "<what>"
".Cont.asasd" ""
"Othreaol" "Value, Other value"
My early solution is
/^([\s\*]+)([\w]+[\s\.\-\>]{0,2}[\w]+)(\s*\:\s)(.*)/
but I have problem with some strings like
Z.15 example : No
the space stops the pattern from matching
H.25 miss here : No
same thing here
I don’t understand why the
Point->IPline is omitted from your example output, but something like the code below should suit you.output