Its good that you create unit tests, but they should be separate from the actual code. Please create a /test dir, and put your unit tests in a separate file(s).

example:

/test/regex/01_range2regex.sh
/test/regex/02_someotherregextest.sh
etc