jobparser 0.13.5 → 0.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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