Skip to content

Commit

Permalink
Fixed versioning regex when there were dashes in it (-).
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Dec 17, 2024
1 parent 61a50a1 commit 1bb7079
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/docs/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ v1.3.1
- Updated docs.
- Fixed Image/Version/Next and Image/Version/Previous always going to the last
clips. The routines are also faster now.
- Fixed Image/Version menu not appearing when the files were on an NFS mount.
- Fixed Image/Version menu not appearing when some directories had numbers in
them.
- Upgraded to OpenEXR v3.3.2.
- Added OpenEXR's headers Compression, Compression Num. Scanlines,
and Is Deep, Is Lossy.
Expand Down
10 changes: 5 additions & 5 deletions src/lib/mrvFl/mrvVersioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,33 @@ namespace mrv
{
std::regex expr;
std::string suffix;
std::string prefix;
std::string regex_string;
static std::string short_prefix = "_v";
std::string orig = ui->uiPrefs->uiPrefsVersionRegex->value();
if (orig.empty())
orig = short_prefix;

if (orig.size() < 5)
{
prefix = "([\\w/:]*[\\._]*" + orig + ")(\\d+)([\\w\\d\\./]*)";
regex_string = "([\\w\\d/:\\-]*?[\\._\\-]*" + orig + ")(\\d+)([\\w\\d\\./]*)";
if (verbose)
{
std::string msg = tl::string::Format(
_("Regular expression created from {0}. "
"It is:\n{1}"))
.arg(orig)
.arg(prefix);
.arg(regex_string);
LOG_INFO(msg);
}
}
else
{
prefix = orig;
regex_string = orig;
}

try
{
expr = prefix;
expr = regex_string;
}
catch (const std::regex_error& e)
{
Expand Down

0 comments on commit 1bb7079

Please sign in to comment.