jobparser 0.13.5 → 0.13.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,7 @@ module JobParser
|
|
2
2
|
module Facets
|
3
3
|
class Postcode < Facet
|
4
4
|
def parse
|
5
|
-
|
6
|
-
postcode_regex.match(@plain_text.gsub("\n", " ")) { |m|
|
5
|
+
POSTCODE_REGEX.match(@plain_text.gsub("\n", " ")) { |m|
|
7
6
|
return m[0]
|
8
7
|
}
|
9
8
|
end
|
data/lib/jobparser/regex.rb
CHANGED
@@ -12,6 +12,7 @@ module JobParser
|
|
12
12
|
LOCATION_REGEX = /(?:location: )([\D]*)$/i
|
13
13
|
SALARY_GROUP_REGEX = /£([\d,]*)(?:.+)£([\d,]*)/
|
14
14
|
CLEAN_SALARY_REGEX = /,|\s/
|
15
|
+
POSTCODE_REGEX = /([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]?\s?[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)/
|
15
16
|
|
16
17
|
# words commonly used in job listings - not sure if this is a good way to go but I think it's worth a go
|
17
18
|
# could scope this regex just to headers
|
data/lib/jobparser/version.rb
CHANGED