# 5.1.2 Route messages based on the given regular expressions

## Business use case narrative

If you want to route the messages based on the given regular expression, you can do it by using mediator in EIP.
Using the Filter and switch mediator you can give regular expression and route the message to the particular endpoint.

## Approaches

- [5.1.1.1 Using switch mediator on given xpath](https://github.com/wso2/product-ei/tree/product-scenarios/product-scenarios/5-Route-messages-between-systems/5.1-Route-based-on-the-content-of-the-messages/5.1.1-Route-messages-based-on-the-given-Xpath/5.1.1.1-Using-switch-mediator-on-given-xpath)
- [5.1.1.2 Using switch mediator on given xpath with namespace](https://github.com/wso2/product-ei/tree/product-scenarios/product-scenarios/5-Route-messages-between-systems/5.1-Route-based-on-the-content-of-the-messages/5.1.1-Route-messages-based-on-the-given-Xpath/5.1.1.2-Using-switch-mediator-on-given-xpath-with-namespace)
- [5.1.1.3 Using filter mediator on given xpath](https://github.com/wso2/product-ei/tree/product-scenarios/product-scenarios/5-Route-messages-between-systems/5.1-Route-based-on-the-content-of-the-messages/5.1.1-Route-messages-based-on-the-given-Xpath/5.1.1.3-Using-filter-mediator-on-given-xpath)
- [5.1.1.4 Using filter mediator on given xpath with namespace](https://github.com/wso2/product-ei/tree/product-scenarios/product-scenarios/5-Route-messages-between-systems/5.1-Route-based-on-the-content-of-the-messages/5.1.1-Route-messages-based-on-the-given-Xpath/5.1.1.4-Using-filter-mediator-on-given-xpath-with-namespace)

