Jump to content

agahi

New Members
  • Posts

    2
  • Joined

  • Last visited

agahi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks Jacques, it worked perfectly. I have a follow up question, lets say I am also certain that there is going to be less than 4 alphabetical characters there and I want to match that as well for example my string would be: $string = "1423/3838/894789BLAH/9387"; or $string = "/73636/83/398/3BLAH"; or $string = "BLAH3//33/3838/7474/" or $string = "/BLAH"; or $string = "636BLAH" AND NOT because there are more than 4 alphabetical characters: $string = "BELABELA3434"; I modified your code as follow but it didn't work. '~\\A[\\d/\S{0,3}]+\\z~'
  2. Hi everybody I am trying to figure out a regex that match any combination/order of digits and backslashes for example it should matches all the following strings: $string = "1423/3838/894789/9387"; or $string = "/73636/83/398/3"; or $string = "3//33/3838/7474/" or $string = "/"; or $string = "636" AND NOT: $string = "a3434"; Any idea?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.