Last active
January 25, 2024 18:43
-
-
Save tngTUDOR/05498bd3366248a4adaba4e057c66bc3 to your computer and use it in GitHub Desktop.
python regex to capture SP names
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A regex to describe a (1)first group, (2) a space, (3)a location enclosed by curly braces | |
# (4)a bar and a space, (5)a second group, (6)a space, (7) a bar and a space, a (8)last group. | |
# Spaces are groups by themselves to ease further treatment | |
pattern = "([^|]+)( )(\\{[\\W\\w\\s]+\\})(\\| )([\\W\\w\\s]+)( )(\\| )([\\W\\w\\s]+)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Getting the name, type and location could be done as follows: