Reputation: 1155
I have string in following format and needs regex to get address values. example lines are following,
var address = 'Uhartia, 64220 Gamarthe, France';
var address = 'Eaux Chaudes
Place de l\'Eglise, 64440 Laruns, France';
I need regex in Python.
Upvotes: 0
Views: 61
Reputation:
This will get the quoted text (in capture group 1)
address\s*=\s*'([^'\\]*(?:\\[\S\s][^'\\]*)*)'
Expanded
address \s* = \s*
'
( # (1 start), Single quoted text
[^'\\]*
(?: \\ [\S\s] [^'\\]* )*
) # (1 end)
'
Upvotes: 1