in reply to Re^2: search of a string in another string with 1 wildcard
in thread search of a string in another string with 1 wildcard
Not quite. You're changing an $m character substring to a single char, so you could wind up with something like: .cdef, a.def, ab.ef, abc.f, abcd. where you're really wanting ..cdef, a..def, ab..ef, abc..f, abcd..; so you really want something a bit more like:
substr($regex, $i, $m) = '.' x $m;
But that's assuming you want your wildcards to be adjacent. If you want the wildcards to be anywhere, you've got a bit more work to do.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: search of a string in another string with 1 wildcard
by carolw (Sexton) on Jul 19, 2014 at 19:08 UTC | |
by roboticus (Chancellor) on Jul 19, 2014 at 22:42 UTC | |
|
Re^4: search of a string in another string with 1 wildcard
by carolw (Sexton) on Jul 27, 2014 at 14:53 UTC | |
by roboticus (Chancellor) on Jul 27, 2014 at 16:59 UTC | |
|
Re^4: search of a string in another string with 1 wildcard
by carolw (Sexton) on Jul 28, 2014 at 18:59 UTC | |
by roboticus (Chancellor) on Jul 29, 2014 at 03:52 UTC | |
|
Re^4: search of a string in another string with 1 wildcard
by carolw (Sexton) on Jul 29, 2014 at 09:05 UTC |