View Single Post
Old 03-16-2013, 12:55 PM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Giuseppe Chillem View Post
Chaley, Those Regular Expression does not want to enter my mind. I suppose I will ask about them forever...

Thanks !
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)
theducks is offline   Reply With Quote