C
C
Cyril2015-12-14 12:00:24
JavaScript
Cyril, 2015-12-14 12:00:24

How to construct a regular expression correctly?

How to properly write a JavaScript regular expression for match so that you can parse a string, say, folder1.subfolder.element , into an array ['folder1', 'subfolder', 'element'] .
It is necessary to match, not split.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel, 2015-12-14
@rusbaron

str.match(/([A-Za-z])*\w+/g)
and how did split not suit you?

J
Jailbird, 2014-04-17
@ernestby

mysql_query("SET NAMES 'utf8'"); 
mysql_query("SET CHARACTER SET 'utf8'");
mysql_query("SET SESSION collation_connection = 'utf8_general_ci'");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question