Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
f3806d56
Commit
f3806d56
authored
Sep 07, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring searchRegExp2
parent
3aafcbd7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+11
-10
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
f3806d56
...
...
@@ -5919,8 +5919,9 @@ function GetDiffDate360( nDay1, nMonth1, nYear1, nDay2, nMonth2, nYear2, bUSAMet
function
searchRegExp2
(
s
,
mask
)
{
//todo протестировать
var
bRes
=
true
;
var
s
=
s
.
toString
().
toLowerCase
();
var
mask
=
mask
.
toString
().
toLowerCase
();
s
=
s
.
toString
().
toLowerCase
();
mask
=
mask
.
toString
().
toLowerCase
();
var
cCurMask
;
var
nSIndex
=
0
;
var
nMaskIndex
=
0
;
var
nSLastIndex
=
0
;
...
...
@@ -5929,30 +5930,30 @@ function searchRegExp2( s, mask ) {
var
nMaskLength
=
mask
.
length
;
var
t
=
false
;
for
(
;
nSIndex
<
nSLength
;
nMaskIndex
++
,
nSIndex
++
,
t
=
false
)
{
var
cCurMask
=
mask
[
nMaskIndex
];
if
(
'
~
'
==
cCurMask
)
{
cCurMask
=
mask
[
nMaskIndex
];
if
(
'
~
'
==
=
cCurMask
)
{
nMaskIndex
++
;
cCurMask
=
mask
[
nMaskIndex
];
t
=
true
;
}
else
if
(
'
*
'
==
cCurMask
)
{
}
else
if
(
'
*
'
==
=
cCurMask
)
{
break
;
}
if
(
(
cCurMask
!=
s
[
nSIndex
]
&&
'
?
'
!=
cCurMask
)
||
(
cCurMask
!
=
s
[
nSIndex
]
&&
t
)
)
{
if
(
(
cCurMask
!=
=
s
[
nSIndex
]
&&
'
?
'
!==
cCurMask
)
||
(
cCurMask
!=
=
s
[
nSIndex
]
&&
t
)
)
{
bRes
=
false
;
break
;
}
}
if
(
bRes
)
{
while
(
1
)
{
var
cCurMask
=
mask
[
nMaskIndex
];
cCurMask
=
mask
[
nMaskIndex
];
if
(
nSIndex
>=
nSLength
)
{
while
(
'
*
'
==
cCurMask
&&
nMaskIndex
<
nMaskLength
)
{
while
(
'
*
'
==
=
cCurMask
&&
nMaskIndex
<
nMaskLength
)
{
nMaskIndex
++
;
cCurMask
=
mask
[
nMaskIndex
];
}
bRes
=
nMaskIndex
>=
nMaskLength
;
break
;
}
else
if
(
'
*
'
==
cCurMask
)
{
}
else
if
(
'
*
'
==
=
cCurMask
)
{
nMaskIndex
++
;
if
(
nMaskIndex
>=
nMaskLength
)
{
bRes
=
true
;
...
...
@@ -5960,7 +5961,7 @@ function searchRegExp2( s, mask ) {
}
nSLastIndex
=
nSIndex
+
1
;
nMaskLastIndex
=
nMaskIndex
;
}
else
if
(
cCurMask
!=
s
[
nSIndex
]
&&
'
?
'
!
=
cCurMask
)
{
}
else
if
(
cCurMask
!=
=
s
[
nSIndex
]
&&
'
?
'
!=
=
cCurMask
)
{
nMaskIndex
=
nMaskLastIndex
;
nSIndex
=
nSLastIndex
++
;
}
else
{
...
...
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