#175125 - 2007-03-31 08:11 AM
Regex Q & A
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4560
Loc: USA
|
For more reading on RegEx see these threads: Input validation (thread that got me going) RFC: Regular Expression UDFs Regular Expression Basic Syntax Reference
All right Howard... now you've got me interested. I've added this as a personal goal to figure out.
One of your examples was to validate an IP address, using the following ^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$ I also found the following that is supposed to do the same thing. \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
These may sound like a dumb questions but I'm not grasping the concept all that well. I'm assuming ^ and $ are defining the boundaries in your example and the \b's are defining the boundaries in the second. Is that correct? Second, why is it necessary to define the beginning and ending of a text range? Why wouldn't this work? \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 564 anonymous users online.
|
|
|