Tjorriemorrie
Tjorriemorrie

Reputation: 17282

Google Refine does not recognize match

Using Google Refine, I'm trying to add a column based on the current column.

The current column contains url params, e.g.

q=how+to+match+google+refine+string&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=sb&gfe_rd=cr&ei=wpFCU-PfDZDd8gektIGoAw

How can I add a column for the q key?

Currently refine just gives me null when I try something as basic as:

value.match('/q/')

Update:

I managed to get the key: '.*?(ip=).*?'

But I'm looking now to get the value to the key. Either till the end of string or next '&'

Upvotes: 0

Views: 113

Answers (2)

Tjorriemorrie
Tjorriemorrie

Reputation: 17282

value.match('.*?(q=)([^&]*).*?')[1]

gives

how+to+match+google+refine+string

Upvotes: 0

Sabuj Hassan
Sabuj Hassan

Reputation: 39365

match() performs matching over the whole string. So try with these two:

.*q.*

or using a word boundary \b:

.*\bq\b.*

Upvotes: 1

Related Questions