View Single Post
Old 03-17-2013, 04:50 PM   #5
Giuseppe Chillem
Groupie
Giuseppe Chillem doesn't litterGiuseppe Chillem doesn't litter
 
Giuseppe Chillem's Avatar
 
Posts: 190
Karma: 134
Join Date: May 2010
Device: IREX DR1000
Quote:
Originally Posted by theducks View Post
It took me a LONG time to get it.

Decoding:
Code:
^ must be at the beginning of the line
( start the [first] capture sequence
the dot any character
{x}   Repetition rule   5 exactly 5 times,  2,5 would be 2 to 5 times,
) end of [first] capture 

the replace:
\1 use the [first capture value]
IMHO dot is not a great match choice (for ISBN) as it assumes that the input is always a valid ISBN< to write a rule you need to know your data rules, and EXCEPTIONS >

ISBN 10 can have an 'X' as the last ^(\d{9}(\d|X|x)) not tested
this supposed to say Match the first 9 digits from the start AND match the next if it is a digit OR x (either case)
Tested, it takes the remaining part of the string:

1616084855IWIWEF -> IWIWEF
Giuseppe Chillem is offline   Reply With Quote