16,736
edits
Changes
→Advanced usage
To avoid this, when using Regex B click on 'Find' to display the records proposed for change and delete all the 3-string 'Of,' records before clicking 'Apply'.
{{man note|take care when pasting a Regex (for example, after testing in a regex editor) into the Parse title details field. Pasting adds redundant spaces before or after the Regex that will prevent it working properly in the Place Completion Tool}}
The predefined regex expressions are as follows, where for brevity we use some variables defined lower.
{{man note|Regex Help|For those new to Python and Regex please review the HOWTO here:<br /> http://docs.python.org/dev/howto/regex.html}}
#<nowiki>"City [,|.] State" is parsed by : r'\s*(?P<'+city_translated +r'>.+?)\s*[.,]\s*(?P<'+state_translated +r'>.+?)\s*$'</nowiki>
#<nowiki>"City [,|.] Country" is parsed by : r'\s*(?P<'+city_translated +r'>.+?)\s*[.,]\s*(?P<'+country_translated +r'>.+?)\s*$'</nowiki>
Here the variables used are:
<pre>
lat_translated = _('lat')
lon_translated = _('lon')
state_translated = _('state')
country_translated = _('country')
</pre>
You can use one of these variables as a group, and the tool will recognise them, and use as values for the corresponding place attributes.