RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Advanced Excel Range
Expression
^(?:=?(?:(?:\[(?<book>[^\\\:\?\*/]+)\])(?:(?<sheet>[^\*\:\?\\\[\]/]{1,31})\!)|(?:(?<sheet>[^=!\[\]\:\?]{1,31})\!))?(?:(?:(?:(?:\$(?:\$)?(?<col1>(?:(?:[A-Z]{1,2})|(?:(?:[A-W][A-Z][A-Z])|(?:[A-X][A-E][A-Z])|(?:[A-X][A-F][A-D])))))|(?<col1>(?:(?:[A-Z]{1,2})|(?:(?:[A-W][A-Z][A-Z])|(?:[A-X][A-E][A-Z])|(?:[A-X][A-F][A-D])))))(?:(?:\$(?:\$)?(?<row1>(?:(?:[1-9][0-9]{0,5})|(?:10[0-3][0-9]{1,4})|(?:104[0-7][0-9]{1,3})|(?:1048[0-4][0-9]{1,2})|(?:10485[0-6][0-9])|(?:104857[0-6]))))|(?<row1>(?:(?:[1-9][0-9]{0,5})|(?:10[0-3][0-9]{1,4})|(?:104[0-7][0-9]{1,3})|(?:1048[0-4][0-9]{1,2})|(?:10485[0-6][0-9])|(?:104857[0-6]))))|(?<name1>[A-Za-z][^\\\:\^\$\[\]\{\}\*\+;,=]{0,249}))(?:\:(?:(?:(?:\$(?:\$)?(?<col2>(?:(?:[A-Z]{1,2})|(?:(?:[A-W][A-Z][A-Z])|(?:[A-X][A-E][A-Z])|(?:[A-X][A-F][A-D])))))|(?<col2>(?:(?:[A-Z]{1,2})|(?:(?:[A-W][A-Z][A-Z])|(?:[A-X][A-E][A-Z])|(?:[A-X][A-F][A-D])))))(?:(?:\$(?:\$)?(?<row2>(?:(?:[1-9][0-9]{0,5})|(?:10[0-3][0-9]{1,4})|(?:104[0-7][0-9]{1,3})|(?:1048[0-4][0-9]{1,2})|(?:10485[0-6][0-9])|(?:104857[0-6]))))|(?<row2>(?:(?:[1-9][0-9]{0,5})|(?:10[0-3][0-9]{1,4})|(?:104[0-7][0-9]{1,3})|(?:1048[0-4][0-9]{1,2})|(?:10485[0-6][0-9])|(?:104857[0-6]))))|(?<name2>[A-Za-z][^\\\:\^\$\[\]\{\}\*\+;,=]{0,249})))?))$
Description
Matching valid MS Excel range and parse it into named groups [including Workbook, Worksheet and named range. Also including column and row validation].
Matches
A1 | A10:B12 | $A$1 | $A$10:XFD1000 | Sheet1!$XF$80 | Sheet1!D10:A23 | [Book1]Sheet1!BB18 | [Book1]Sheet1!BB18:TT34
Non-Matches
[Book1]AB1 | ZZZ10 | A1048577
Author Rating: Not yet rated. Pavel Sommer
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Java regex says pattern malformed
Name: Ola Lundell
Date: 5/30/2018 9:00:44 AM
Comment:
Java regex says pattern malformed because "Named capturing group <sheet> is already defined"


Title: Java regex says pattern malformed
Name: Ola Lundell
Date: 5/30/2018 9:00:36 AM
Comment:
Java regex says pattern malformed because "Named capturing group <sheet> is already defined"


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials