Example of regexp

Permalink Browser Info Environment
Hi,

I want to create a redirect rule for all countries in the Americas, 51 Country Codes.
AV AC AA BF BB VI CJ CU DO DR GJ GP HA JM MB MH RQ SC ST RN VC TD TK VQ BH CS ES GT HO MX NU PM AR BL BR CI CO EC FK FG GY PA PE NS UY VE BD CA GL SB US

How do I specify the regexp in that case?

Type: Discussion
Status: In Progress
busters
View Replies:
goutnet replied on at Permalink Reply
goutnet
I don't think you want to do that …

The "Country" field for any of the states of the US would be "US", so simply using the country would be enough to get you sorted.

Nevertheless if you wanted to match all states (in the states field), you would separate your alternative by | (pipe), example to match foo or bar you type foo|bar, so for your example:

AV|AC|AA|BF|BB|VI

and so on.

There again, using the Country matching would be a lot easier IMO.
goutnet replied on at Permalink Reply
goutnet
Oups, I just saw you are using the 5.6 version which does not come with state matching at all… so you really *have to* use the country matching.

If you come accross the 5.7 version, you will have the state matching. 5.6 is Concrete5 legacy, and only bugfixes happen here :)
goutnet replied on at Permalink Reply
goutnet
Link to 5.7 version (but that requires you to upgrade your site to 5.7):

https://www.concrete5.org/marketplace/addons/maxmind-ip-geoloc-for-5...
busters replied on at Permalink Reply
busters
It is country that I want to match on. The codes is for every country in south, central and north -America.

So thanks for the advice, the pipe was what I was after.
busters replied on at Permalink Reply 1 Attachment
busters
I've separated the country codes with pipe but I still cannot get it to work.

Switching to exact match and only typing SE gives me the desired result.
goutnet replied on at Permalink Reply
goutnet
you should try lowercase

se|dk
busters replied on at Permalink Reply
busters
Still no difference.
goutnet replied on at Permalink Reply
goutnet
can you activate debug and give me the log?
busters replied on at Permalink Reply
busters
I did, but can't figure out where the log is located.
goutnet replied on at Permalink Reply
goutnet
each trace is shown in concrete5 logs
busters replied on at Permalink Reply
busters
[Redirect Americas#0] no assertion successfully matched the incoming visitor, rule is skipped
goutnet replied on at Permalink Reply
goutnet
There should be other lines before that ?

Can you PM me an access to your site so I get a look?

Also does it work if you only input one name as the regex ? (eg: se)

there may be something wrong here… Can you PM me a link to your site with an access (and preferably and ssh access too so I can give a try to check what's going wrong) ?

Please do not post any credentials here, this forum is somehow public …

concrete5 Environment Information

# concrete5 Version
5.6.3.4

# concrete5 Packages
Advanced Forms (1.11.1), Extended Google Map (3.2), Image Slider (1.1), Internationalization (1.3), List files from set (1.0.4), Login (1.1.1), MaxMind IP-GeoLoc (1.0.3), Pro Events (11.5.0), Pro News (5.0.2), Sortable Fancybox Gallery (1.17).

# concrete5 Overrides
blocks/autonav, blocks/sortable_fancybox_gallery, blocks/sixeightforms, blocks/content, blocks/pro_event_list, blocks/pronews_list, blocks/image, blocks/extended_google_map, blocks/image_slider, blocks/login, blocks/list_files_from_set, languages/de_DE, languages/sv_SE, languages/fr_FR, languages/es_ES, languages/zh_CN, languages/ru_RU, themes/standardherrklader, themes/systemweaver, themes/automekano, themes/leonlurjetrophy_new, themes/caroliner, themes/uniteit, themes/bakdelen, themes/leonlurjetrophy, themes/p3firsttheme, themes/hannaherngren, themes/goldendays, themes/decobags, themes/ProWeb, themes/ljusavdelningen, themes/demotheme, themes/gotsprings, themes/alignment_academy, themes/amhult2, themes/caroliner-group

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - Off

# Server Software
Apache

# Server API
apache2handler

# PHP Version
5.4.45-0+deb7u5

# PHP Extensions
apache2handler, bcmath, bz2, calendar, Core, ctype, curl, date, dba, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, json, libxml, mbstring, mhash, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, Phar, posix, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, zlib.

# PHP Settings
max_execution_time - 120
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 256M
post_max_size - 100M
sql.safe_mode - Off
upload_max_filesize - 100M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - nocache
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:49.0) Gecko/20100101 Firefox/49.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.