I want to get the following:-
Input
GET /1.1/friendships/list.json?user_id=123 HTTP/1.1
GET /1.1/friendships/list.json HTTP/1.1
GET /1.1/users/show.json?include_entities=1&user_id=321 HTTP/1.1
GET /1.1/friendships/list.json?user_id=234 HTTP/1.1
GET /1.1/friendships/create.json HTTP/1.1
Output
/1.1/friendships/list.json
/1.1/friendships/list.json
/1.1/users/show.json
/1.1/friendships/list.json
/1.1/friendships/create.json
I have been able to match till the question mark character. I want to match a character that is either a question mark or a blank space. Here is what I have so far.
([A-Z])+ (\S)+[\?]
r = re.compile(r'\w+ ([/\w\.]+)')andr.match(<string>).groups(1)