1 Reply Latest reply on Jun 7, 2021 8:51 AM by Nico Heinze

    REG_MATCH: URL validation

    Alessandro Corti Seasoned Veteran

      I’m looking for a decent regular expression to validate URLs that were entered as user input with.

      I've found a list of possibile regular expression in the following URL: In search of the perfect URL validation regex (mathiasbynens.be)

      None of them can work well using the REG_MATCH expression and I cannot find the reason of the fail.

       

      Can you help me to find a working regular expression pattern for the REG_MATCH?

       

        • 1. Re: REG_MATCH: URL validation
          Nico Heinze Guru

          I think the reason is that PowerCenter uses a (more or less) Perl5 compatible regex while many of the regex on the web site you mentioned are formulated in other languages. You cannot simply copy-and-paste them into the expression editor, you have to adapt them to the syntax that PowerCenter understands.

          Right now I'm too busy to build them out of the blue, so it would help if you could name a few sample URLs that you need to be accepted.

           

          In general I recommend that you use only ASCII characters in URLs, no Thai characters (to name one example). Building expressions with any characters outside the ASCII character set is a nightmare (to say at least); if you need them, then my suggestion is to use a Java transformation because in Java it's far easier to identify "letters" in all languages (which are allowed in URLs) than in PowerCenter.

           

          Regards,

          Nico