aboutsummaryrefslogtreecommitdiffstats
path: root/src/Lib.hs
diff options
context:
space:
mode:
authorTeddy Wing2017-08-17 20:48:55 +0200
committerTeddy Wing2017-08-17 20:48:55 +0200
commitce5e3cf7fe71c5c508c7eaecfb2280b9346e792a (patch)
treeceddcc8784fb2b98d1332de10849cae5a61ae61d /src/Lib.hs
parent3ee61aec34d6c652a485c3098d50ce4a15b542e7 (diff)
downloadsorbot-ce5e3cf7fe71c5c508c7eaecfb2280b9346e792a.tar.bz2
gitRemoteSetOriginAction: Use regex capture group
Finally figured out how to get a capture group out of the regex match. Needed to coerce as a two-dimensional `String` list. Thanks to: - https://stackoverflow.com/questions/24699279/cant-capture-a-group-in-a-string - https://stackoverflow.com/questions/6729158/find-all-capturing-groups-of-a-regular-expression Get the captured group and set it to the URL to insert into the database. It lives in the second element of the first list: Prelude Text.Regex.TDFA> "git remote set origin https://example.new" =~ "^git remote set origin ([^ ]+)$" :: [[String]] [["git remote set origin https://example.new","https://example.new"]] Prelude Text.Regex.TDFA> "" =~ "^git remote set origin ([^ ]+)$" :: [[String]] []
Diffstat (limited to 'src/Lib.hs')
0 files changed, 0 insertions, 0 deletions