No BSD License  

Highlights from
ExpandRegexSet

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 1.97 KB File ID: #3935
image thumbnail

ExpandRegexSet

by Michael Robbins

 

03 Sep 2003 (Updated 05 Sep 2003)

Turns an expression like abc[def] into {'abcd', ...

| Watch this File

File Information
Description

EXPANDREGEXSET is a function written for CSSM as an
example and is not well thought out. It turns an expression like abc[def] into {'abcd', ...
'abce','abcf'}

This is similar to REGEXPIOR which can be found in my REGEXTOOLS (regular expression tools) at MATLAB Central.

USAGE
>> ExpandRegexSet('abc[def]ghi[jkl][mno]')'
ans =
Columns 1 through 6
'abcdghijm' 'abcdghijn' 'abcdghijo' 'abcdghikm' 'abcdghikn' 'abcdghiko'
Columns 7 through 12
'abcdghilm' 'abcdghiln' 'abcdghilo' 'abceghijm' 'abceghijn' 'abceghijo'
Columns 13 through 18
'abceghikm' 'abceghikn' 'abceghiko' 'abceghilm' 'abceghiln' 'abceghilo'
Columns 19 through 24
'abcfghijm' 'abcfghijn' 'abcfghijo' 'abcfghikm' 'abcfghikn' 'abcfghiko'
Columns 25 through 27
'abcfghilm' 'abcfghiln' 'abcfghilo'

CAVEAT:
Nested brackets and escaped brackets are not supported.
Only square brackets are supported

IT'S NOT FANCY BUT IT WORKS

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
expression, findstr, regex, regexp, regexprep, regular, strfind, strings
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Contact us