I am very bad with RegEx. Can anyone help me getting RegEx for this pattern.
Here is the pattern
(Words).(Single Character, can be empty)(white spaces)(words, can be empty):(Words, can be empty)
Here are the examples
VERS. 2.00: Ver 2.00
WRAP. NO:
STRT.F 4501.0000:START DEPTH
WELL. C5 1H:WELL
FTG GTG. :LOCATION FOOTAGE DESCRIPTION
Update 1:
Here is what I have done.
string re1 = "((?:[a-z][a-z]+))"; // Word 1
string re2 = ".*?"; // Non-greedy match on filler
string re3 = "(\\.)"; // Any Single Character 1
string re4 = "(.)"; // Any Single Character 2
string re5 = "(\\s+)"; // White Space 1
string re6 = "((?:[a-z][a-z]+))"; // Word 2
string re7 = ".*?"; // Non-greedy match on filler
string re8 = "(:)"; // Any Single Character 3
string re9 = ".*?"; // Non-greedy match on filler
string re10 = "(?:[a-z][a-z]+)"; // Uninteresting: word
string re11 = ".*?"; // Non-greedy match on filler
string re12 = "((?:[a-z][a-z]+))"; // Word 3
Regex r = new Regex(re1 + re2 + re3 + re4 + re5 + re6 + re7 + re8 + re9 + re10 + re11 + re12, RegexOptions.IgnoreCase | RegexOptions.Singleline);
Update 2:
Okay. I have tried something new. Here is my regex.
(\.)(.)(\s+)(4501.0000)(:)
Here is the input.
STRT DTG.F 4501.0000:START DEPTH
And here is output.
STRT DTG
.
F
4501.0000
:
START DEPTH
Now I need to only replace 4501.0000 with regex for sentence (e.g. "some text" or "some more text"),
The header section of the LAS file (generally) has this kind of format.
The regex can be like this.
Explanation
DEMO