-
Notifications
You must be signed in to change notification settings - Fork 25.1k
Closed
Labels
Needs: Triage 🔍Platform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.
Description
Description
Hi there,
we're just trying add some regex to verify user input in the product,
but somehow it will crash directly by some specify user input on Android (iOS worked perfectly)
our regex is to verify user email format like following
/^(?=.{6,80}$)([A-Za-z0-9_\-]+[\.]?)*[A-Za-z0-9_\-]+@([A-Za-z0-9_\-]+)\.([A-Za-z0-9_\-]+[\.]?)*([A-Za-z0-9_\-]*[A-Za-z][A-Za-z])$/I;
and user input is 'aaaaaaaaaabbbbbbbbbbcccccccccc'
crash point is at Hermes, which show RangeError: Maximum regex stack depth reached, js engine: hermes
, but a strange thing is that , once enable debug mode from Developer Menu, it won't crash any more
React Native version:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
Memory: 36.56 MB / 16.00 GB
Shell: 5.8 - /usr/local/bin/zsh
Binaries:
Node: 14.4.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.8.3 - /Users/alan_hsueh/.rvm/gems/ruby-2.7.0/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
Languages:
Java: 12.0.1 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
- use <TextInput /> to input data
aaaaaaaaaabbbbbbbbbbcccccccccc, - bind Button submit, using regex check is email format with
/^(?=.{6,80}$)([A-Za-z0-9_\-]+[\.]?)*[A-Za-z0-9_\-]+@([A-Za-z0-9_\-]+)\.([A-Za-z0-9_\-]+[\.]?)*([A-Za-z0-9_\-]*[A-Za-z][A-Za-z])$/i
Expected Results
should show it's not a valid input
Snack, code example, screenshot, or link to a repository:
let regEmail = /^(?=.{6,80}$)([A-Za-z0-9_\-]+[\.]?)*[A-Za-z0-9_\-]+@([A-Za-z0-9_\-]+)\.([A-Za-z0-9_\-]+[\.]?)*([A-Za-z0-9_\-]*[A-Za-z][A-Za-z])$/I;
if (regEmail.test(searchInputText) === false) {
Toast.show(strings.alert.email_format_error, {
duration: Toast.durations.LONG,
position: Toast.positions.BOTTOM,
shadow: true,
animation: true,
hideOnPress: true,
delay: 0,
});
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs: Triage 🔍Platform: AndroidAndroid applications.Android applications.StaleThere has been a lack of activity on this issue and it may be closed soon.There has been a lack of activity on this issue and it may be closed soon.