Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(?<name>.+) (?<date>.+) Lat=\s*(?<lat>-?\d+\.\d*)\s*Lon=\s*(?<lon>-?\d+\.\d*) (?<dep>.+) (?<dt>.+) Moment Tensor: Expo=\d+\s*(?<cmt>.+) .+ .+ (?<faultPlane>.+strike=(?<strike>-?\d+\.?\d*)\s*dip=(?<dip>-?\d+\.?\d*)\s*slip=(?<slip>-?\d+\.?\d*))
/
gm

Description

This converts CMT Global Standard format to CMT for bb.m MATLAB

Submitted by Syed Faheemuddin - 6 years ago