package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?ims)(?:CRITERION SUMMARY.*?\n)(.*?)(?:\n{2}|\.PLOT PAGE)`)
var str = ` Fr. 180 135.000f -1,320.8 45 -2,911.4 8,472.3 27 31,259.0
Fr. 184 138.000f -1,032.5 44 -2,367.4 4,966.8 20 25,416.1
Fr. 189 141.750f -689.6 41 -1,687.4 1,530.8 8 18,112.6
FPP 143.250f -421.6 30 -1,415.4 697.3 5 15,191.2
------------------------------------------------------------------------------
LONG. STRENGTH - PORT CONDITION CRITERION SUMMARY
Largest Shear/limit: 47.3% at 140.000f
Largest Bending Moment/limit: 32.4% at 130.572f (Hogging)
Largest Shear: 2,094.1 MT at 120.000f
Largest Bending Moment: -42,063 MT-m. at 76.500f (Sagging)
.PLOT PAGE
D&T=19-11-15 11:25:20
PAG= 398
P&V=GHS 14.62B
TIT=Vuyk Engineering Rotterdam B.V.
TIT=MV FJELL - IMO 8766296
HDG=6.09 - BALLASTING - STEP 9\
HDG=DAMAGE CONDITION\
CAT=
DAM= with FLOODING
UNT=M. MT CU.M.
ORV=Base plane
SPG= 1.025 STD
WAV= 0
LIM=LONG. STRENGTH - PORT CONDITION
HEL= 4.848391
LST= 375
LOC SHR SLN SLP MOM MLN MLP
-148 0 -554 378 0 5940 -3994
-148 0 -554 378 0 5940 -3994
-147.07 -1.110508 -722.6383 556.4048 1.96067 7751.208 -5850.188
-147.07 -1.110508 -722.6484 556.4155 1.96067 7751.316 -5850.3
-146.9999 -6.46569 -735.3599 569.8632 2.33537 7887.84 -5990.214
-146.9999 -6.46569 -735.37 569.8739 2.33537 7887.949 -5990.325
-146.9968 -6.697881 -735.9165 570.452 2.360113 7893.819 -5996.341
-146.4246 -53.68822 -839.6799 680.2248 20.21089 9008.258 -7138.457
-146.4246 -53.68822 -839.69 680.2355 20.21089 9008.366 -7138.568
-146.25 -69.215 -871.3339 713.712 31.2016 9348.228 -7486.869 `
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/