Regular expressions

From Edgar BV Wiki
Jump to: navigation, search

RegexBuddy is your regular expression friend.

PCRE Regular expressions

List of regular expressions that can be used with preg functions in PHP

Finding weight value in kilograms

(?P<kg>(?:(?:[0-9\,\.]+)|(?:[0-9\,\.]+)\s*?(?:[\–\-]|–|to)\s*?(?:[0-9\,\.]+))\s*?kg)

Example:

1 kg
1kg
2.2 kg
5,4 kg
3 - 4 kg
3.1 – 9.1 kg
3.1-9.1 kg