PHP Using PHP eregi Function - Solve XML XSD Pattern Definition

  • Thread starter Thread starter Hootenanny
  • Start date Start date
  • Tags Tags
    Function Php
AI Thread Summary
The discussion revolves around converting an XML XSD pattern definition into an ereg regular expression for validating UK driving license numbers. The original pattern is complex, involving specific character sets and sequences. The user struggled with the conversion and sought assistance from the forum. After some back-and-forth, it was confirmed that adding slashes to the regex helped in testing its grammar. Ultimately, the user expressed gratitude for the help received, indicating that the regex now works for their validation needs.
Hootenanny
Staff Emeritus
Science Advisor
Gold Member
Messages
9,621
Reaction score
9
Hi all,

I have this xml xsd pattern defintion;

Code:
[A-Z,0-9]{5}[0-9][0,1,5,6][0-9]([0][1-9]|[1-2][0-9]|[3][0,1])[0-9][A-Z,0-9]{3}[A-Z]{2}

and I need to convert it into an ereg regular expression to valid some input from a form. I've been at this for hours but can't seem to get anywhere. Can any of you guys help out...?
 
Technology news on Phys.org
This is an extended "legal" regex:
Code:
/[A-Z,0-9]{5}[0-9][0,1,5,6][0-9]\([0][1-9]|[1-2][0-9]|[3][0,1]\)[0-9][A-Z,0-9]{3}[A-Z]{2}/

But I have no way of knowing if it works or even finds what you need. I added /'s to test the grammar
 
jim mcnamara said:
This is an extended "legal" regex:
Code:
/[A-Z,0-9]{5}[0-9][0,1,5,6][0-9]\([0][1-9]|[1-2][0-9]|[3][0,1]\)[0-9][A-Z,0-9]{3}[A-Z]{2}/

But I have no way of knowing if it works or even finds what you need. I added /'s to test the grammar
The slashes worked Jim, thanks alot! FYI I'm using the regex to verify UK driving license numbers. Thanks again.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top