Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rd-ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
苍蓝
rd-ygopro
Commits
ca26d548
Commit
ca26d548
authored
Nov 16, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for invalid regex
parent
1ad5b7b9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
gframe/game.cpp
gframe/game.cpp
+20
-8
No files found.
gframe/game.cpp
View file @
ca26d548
...
@@ -2082,18 +2082,30 @@ void Game::takeScreenshot() {
...
@@ -2082,18 +2082,30 @@ void Game::takeScreenshot() {
bool
Game
::
CheckRegEx
(
const
wchar_t
*
text
,
const
wchar_t
*
exp
,
bool
exact
)
{
bool
Game
::
CheckRegEx
(
const
wchar_t
*
text
,
const
wchar_t
*
exp
,
bool
exact
)
{
//if(std::wregex(exp) == NULL)
//if(std::wregex(exp) == NULL)
// return false;
// return false;
bool
result
;
try
{
if
(
exact
)
if
(
exact
)
return
!!
std
::
regex_match
(
text
,
std
::
wregex
(
exp
));
result
=
std
::
regex_match
(
text
,
std
::
wregex
(
exp
));
else
else
return
!!
std
::
regex_search
(
text
,
std
::
wregex
(
exp
));
result
=
std
::
regex_search
(
text
,
std
::
wregex
(
exp
));
}
catch
(...)
{
result
=
false
;
}
return
result
;
}
}
bool
Game
::
CheckRegEx
(
std
::
wstring
text
,
const
wchar_t
*
exp
,
bool
exact
)
{
bool
Game
::
CheckRegEx
(
std
::
wstring
text
,
const
wchar_t
*
exp
,
bool
exact
)
{
//if(std::wregex(exp) == NULL)
//if(std::wregex(exp) == NULL)
// return false;
// return false;
bool
result
;
try
{
if
(
exact
)
if
(
exact
)
return
!!
std
::
regex_match
(
text
,
std
::
wregex
(
exp
));
result
=
std
::
regex_match
(
text
,
std
::
wregex
(
exp
));
else
else
return
!!
std
::
regex_search
(
text
,
std
::
wregex
(
exp
));
result
=
std
::
regex_search
(
text
,
std
::
wregex
(
exp
));
}
catch
(...)
{
result
=
false
;
}
return
result
;
}
}
const
char
*
Game
::
GetLocaleDir
(
const
char
*
dir
)
{
const
char
*
Game
::
GetLocaleDir
(
const
char
*
dir
)
{
if
(
!
gameConf
.
locale
||
!
wcscmp
(
gameConf
.
locale
,
L"default"
))
if
(
!
gameConf
.
locale
||
!
wcscmp
(
gameConf
.
locale
,
L"default"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment