You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
static$eaw_regex; // East Asian Width regex. Characters that count as 2 characters as they're "wide" or "fullwidth". See http://www.unicode.org/reports/tr11/tr11-19.html
@@ -237,12 +235,8 @@ function safe_str_pad( $string, $length ) {
237
235
* @return int The string's width.
238
236
*/
239
237
functionstrwidth( $string ) {
240
-
static$eaw_regex; // East Asian Width regex. Characters that count as 2 characters as they're "wide" or "fullwidth". See http://www.unicode.org/reports/tr11/tr11-19.html
241
-
static$m_regex; // Mark characters regex (Unicode property "M") - mark combining "Mc", mark enclosing "Me" and mark non-spacing "Mn" chars that should be ignored for spacing purposes.
@@ -272,3 +266,29 @@ function strwidth( $string ) {
272
266
}
273
267
returnsafe_strlen( $string );
274
268
}
269
+
270
+
/**
271
+
* Get the regexs generated from Unicode data.
272
+
*
273
+
* @param string $idx Optional. Return a specific regex only. Default null.
274
+
* @return array|string Returns keyed array if not given $idx or $idx doesn't exist, otherwise the specific regex string.
275
+
*/
276
+
functionget_unicode_regexs( $idx = null ) {
277
+
static$eaw_regex; // East Asian Width regex. Characters that count as 2 characters as they're "wide" or "fullwidth". See http://www.unicode.org/reports/tr11/tr11-19.html
278
+
static$m_regex; // Mark characters regex (Unicode property "M") - mark combining "Mc", mark enclosing "Me" and mark non-spacing "Mn" chars that should be ignored for spacing purposes.
0 commit comments