1 parent ddd3958 commit 88e9e39Copy full SHA for 88e9e39
1 file changed
README.md
@@ -1092,3 +1092,32 @@ function getAbsSum(arr){
1092
1093
---
1094
**[⬆ Back to Top](#header)**
1095
+
1096
1097
1098
+##### 30. Write a function that take a string and write a REGEXP that matches any characters except letters, digits and spaces.
1099
1100
+```js
1101
+function matchAny(str){
1102
+ //Write Your solution Here
1103
+};
1104
1105
1106
+console.log(matchAny('Csxdzontains_underscore ')); //[ '_' ]
1107
+console.log(matchAny('Csxdzontains_underscore $ * P')); //[ '_', '$', '*' ]
1108
+```
1109
1110
+<details><summary style="cursor:pointer">Solution</summary>
1111
1112
1113
1114
+ const REGEXP = /[^a-z0-9 ]/gi;
1115
+ return str.match(REGEXP)
1116
1117
1118
1119
1120
+</details>
1121
1122
+---
1123
+**[⬆ Back to Top](#header)**
0 commit comments