Sorry ISBN[ -\d]+X? will not work. It will allow
"ISBN sds sdds 13 978-1-847193-57-5 ssdsd"
Main Topics
Browse All TopicsHi Friends,
I having an ISBN regular expression ISBN\x20(?=.{13}$)\d{1,5}(
but it only matches to these three formats ISBN 0 93028 923 4,ISBN 1-56389-668-0
and ISBN 1-56389-016-X.
I found some serious like this ISBN 1847193579 and ISBN 13 978-1-847193-57-5.
So can anybody suggest a better expression?
Regards
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
* my solution:
ISBN[\x20\x2D]{0,1}(?:13[\
* Short explanation:
1) match IBSN or IBSN 13 with/without hyphens/spaces, non-backreferencing
ISBN[\x20\x2D]{0,1}(?:13[\
2) first backreference group, \1, check for IBSN 13 prefix (978 or 979)
(978[\x20\x2D]|979[\x20\x2
3) check length of remaining (max 9 digits + 1 digit or X, max 3 total punctuation (- or space) )
(?=[0-9\x20\x2D]{9,12}[0-9
4) second backreference, \2, 'group identifier' , i.e. language
(\d{1,5}?)[\x20\x2D]{0,1}
5) third backreference, \3, publisher
(\d{1,7})[\x20\x2D]{0,1}
6) fourth backreference, \4, item number
(\d{1,6}?)[\x20\x2D]{0,1}
7) final backreference, \5, checksum number
([0-9xX])
8) end of line / string
$
** Sample replacement string
ISBN 978-\2-\3-\4-\5
-- This will output any given IBSN in the 'new' 13 digit format. Although, if the ISBN is given as a string without punctuation, it will just make a reasonable guess on where the hyphens should be placed
Business Accounts
Answer for Membership
by: cxrPosted on 2008-10-31 at 04:02:00ID: 22848915
Maybe you can use something simpler, like ISBN followed by any combination of digits, dashes and spaces, optionally ending with X?
ISBN[ -\d]+X?