• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

regular expression

  1. SneakyDave

    How to apply regular expressions to unicode characters?

    I have a regular expression that replaces characters and numbers in a string. I use preg_replace and a regular expression of "/[a-z\d]/i" to do that. $newtext= preg_replace("/[a-z\d]/i", "x", $originaltext); Is there an easy way to extend that regex to include unicode characters? Edited to...
  2. Mr Lucky

    help with a currency regular expression please

    What I want is to match the value so a user must put in a currency symbol and amount I can do this with a specific currency, e.g. ^\£(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$ for £ However I want to allow $ and € as well (or ideally any currency symbol) Can someone please help with this? Thanks