When you set up Conditions with Manage, you can choose to Generate Components to automatically generate Regular Expressions for your JavaScript code.
See the following references for help understanding Regular Expressions:
- For a basic introduction to RegEx: http://www.zytrax.com/tech/web/regex.htm#intro
- Wikipedia: http://en.wikipedia.org/wiki/Regular_expression
Regular Expressions are used for JavaScript. For more information on JavaScript, see the JavaScript Kit. This site provides comprehensive JavaScript tutorials and 400+ free scripts.
Regular Expressions provide a powerful way to match criteria.
By default, when choosing to Generate Components for conditions, all URL conditions default to a Regular Expression (R).
You can leave them as they are or make adjustments to them. Please consider checking Ignore Case in the edit options for each component.
Useful RegEx Information
? | Makes the preceding character optional. |
^ | Beginning of the string. |
$ | End of the string. |
.* | Match anything. |
Use Cases
Host: .* This symbol means match anything/everything = global async (Do not load in the Bootstrap)
Host: | This symbol means you want the condition to match multiple criteria
Example:
(mysite\.demo\.ensighten\.com|mysite\.demo\.ensighten\.com)
Path: For a home page, adding {0,1} to ^(/{0,1})$ means that having the "/" trailing the home page URL is optional
Hash Fragment: Currently the "#" is added by default but it can be removed.
Comments
0 comments
Article is closed for comments.