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
94fd791f
Commit
94fd791f
authored
May 05, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add xregexp externs
parent
5c5773eb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
5 deletions
+97
-5
build/configs/webexcel.json
build/configs/webexcel.json
+1
-1
build/configs/webpowerpoint.json
build/configs/webpowerpoint.json
+1
-1
build/configs/webword.json
build/configs/webword.json
+1
-1
common/externs/global.js
common/externs/global.js
+0
-2
common/externs/xregexp-3.0.0.js
common/externs/xregexp-3.0.0.js
+94
-0
No files found.
build/configs/webexcel.json
View file @
94fd791f
...
...
@@ -264,8 +264,8 @@
"externs"
:
[
"../common/externs/global.js"
,
"../common/externs/jquery-3.2.js"
,
"../common/externs/xregexp-3.0.0.js"
,
"../../web-apps/vendor/sockjs/sockjs.min.js"
,
"../../web-apps/vendor/xregexp/xregexp-all-min.js"
,
"../../web-apps/vendor/jszip/jszip.min.js"
,
"../../web-apps/vendor/jszip-utils/jszip-utils.min.js"
],
...
...
build/configs/webpowerpoint.json
View file @
94fd791f
...
...
@@ -252,8 +252,8 @@
"externs"
:
[
"../common/externs/global.js"
,
"../common/externs/jquery-3.2.js"
,
"../common/externs/xregexp-3.0.0.js"
,
"../../web-apps/vendor/sockjs/sockjs.min.js"
,
"../../web-apps/vendor/xregexp/xregexp-all-min.js"
,
"../../web-apps/vendor/jszip/jszip.min.js"
,
"../../web-apps/vendor/jszip-utils/jszip-utils.min.js"
],
...
...
build/configs/webword.json
View file @
94fd791f
...
...
@@ -244,8 +244,8 @@
"externs"
:
[
"../common/externs/global.js"
,
"../common/externs/jquery-3.2.js"
,
"../common/externs/xregexp-3.0.0.js"
,
"../../web-apps/vendor/sockjs/sockjs.min.js"
,
"../../web-apps/vendor/xregexp/xregexp-all-min.js"
,
"../../web-apps/vendor/jszip/jszip.min.js"
,
"../../web-apps/vendor/jszip-utils/jszip-utils.min.js"
],
...
...
common/externs/global.js
View file @
94fd791f
...
...
@@ -43,9 +43,7 @@ var AscCommonWord;
var
AscCommonExcel
;
var
AscCommonSlide
;
function
$
(){}
function
jq
(){}
function
jQuery
(){}
function
DE
(){}
function
SE
(){}
function
SSE
(){}
...
...
common/externs/xregexp-3.0.0.js
0 → 100644
View file @
94fd791f
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//This file containes definition of object which used in api.js
//It need to prevent minimize the name of object's method.
function
XRegExp
()
{}
/**
* Executes a regex search in a specified string. Returns a match array or `null`. If the provided
* regex uses named capture, named backreference properties are included on the match array.
* Optional `pos` and `sticky` arguments specify the search start position, and whether the match
* must start at the specified position only. The `lastIndex` property of the provided regex is not
* used, but is updated for compatibility. Also fixes browser bugs compared to the native
* `RegExp.prototype.exec` and can be used reliably cross-browser.
*
* @memberOf XRegExp
* @param {String} str String to search.
* @param {RegExp} regex Regex to search with.
* @param {Number} [pos=0] Zero-based index at which to start the search.
* @param {Boolean|String} [sticky=false] Whether the match must start at the specified position
* only. The string `'sticky'` is accepted as an alternative to `true`.
* @returns {Array} Match array with named backreference properties, or `null`.
* @example
*
* // Basic use, with named backreference
* let match = XRegExp.exec('U+2620', XRegExp('U\\+(?<hex>[0-9A-F]{4})'));
* match.hex; // -> '2620'
*
* // With pos and sticky, in a loop
* let pos = 2, result = [], match;
* while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) {
* result.push(match[1]);
* pos = match.index + match[0].length;
* }
* // result -> ['2', '3', '4']
*/
XRegExp
.
exec
=
function
(
str
,
regex
,
pos
,
sticky
)
{};
/**
* Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in
* the outer pattern and provided subpatterns are automatically renumbered to work correctly.
* Native flags used by provided subpatterns are ignored in favor of the `flags` argument.
*
* @memberOf XRegExp
* @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows
* `({{name}})` as shorthand for `(?<name>{{name}})`. Patterns cannot be embedded within
* character classes.
* @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A
* leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present.
* @param {String} [flags] Any combination of XRegExp flags.
* @returns {RegExp} Regex with interpolated subpatterns.
* @example
*
* const time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', {
* hours: XRegExp.build('{{h12}} : | {{h24}}', {
* h12: /1[0-2]|0?[1-9]/,
* h24: /2[0-3]|[01][0-9]/
* }, 'x'),
* minutes: /^[0-5][0-9]$/
* });
* time.test('10:59'); // -> true
* XRegExp.exec('10:59', time).minutes; // -> '59'
*/
XRegExp
.
build
=
function
(
pattern
,
subs
,
flags
)
{};
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