_
_
_umr2017-05-24 15:17:34
JavaScript
_umr, 2017-05-24 15:17:34

How to make the regular season more strict?

Now with a similar regex:

preg_match("/update.[0-9]+.[a-z]+/", $input_line, $output_array);

The following passes: update/213/he/he/he
And according to the idea, only update/213/he
How to be?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
0
0xD34F, 2018-08-22
@nickola105

Probably, instead of all the same, it should be
Object.keys(this.props.landingState).length > 0

I
Ivan Koryukov, 2017-05-24
@Umr001

You need to add markers for the beginning and end of the line. Like this:
Otherwise, the expression will work on any lines in which (in the middle of a long text, for example) there is the desired pattern.
Well, slashes must be explicitly specified.

D
Dmitry, 2017-05-24
@slo_nik

Good afternoon.
Try doing this:

preg_match("#update\/[0-9]+\/[a-z]+#", $input_line, $output_array);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question