Skip to content

Instantly share code, notes, and snippets.

@vlsulliv
Created November 14, 2021 08:01
Show Gist options
  • Save vlsulliv/6e5f0626228e7017bdd23a5ab87be957 to your computer and use it in GitHub Desktop.
Save vlsulliv/6e5f0626228e7017bdd23a5ab87be957 to your computer and use it in GitHub Desktop.
^ matches beginnig of a line
$ matches end of line
. matches any chatacter (except eol)
\s matches whitespace
\S matches any non whitespace
* matches a repeat of a character zero or more times
*? matches a repeat of a characrer zero or more times (non-greedy)
+ matches a repeat of a character one or more times
+? matches a repeat of a character one or more times (non greedy)
[aeiou] matches a single character in the lisetd set
[^XYZ] matches a single characret NOT IN the listed set
[a-z0-9] the set of characters can include a range
( indicates where string extraction starts
) indicates end of string extraction
match a parentesis:
Firstly, you can escape it using a backslash -- \(
Alternatively, since it's a single character, you can put it in a character class, where it doesn't need to be escaped -- [(]
,ST_GeomFromText.+?\).+?\) removes last value (geoForm) from the insert statement
INSERT INTO GreaterManchesterCrime (CrimeID,CrimeTS,Location,LSOA,Type,Outcome,theGeom) VALUES ('E1:68:4D:92:FB:10','2018-08-23 15:57:24','On or near Back Burnaby Street','Bolton 021E','Violence and sexual offences','Unable to prosecute suspect',ST_GeomFromText('POINT(-2.445266 53.568947)',4326));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment