# Which two AS paths match?

Given the following regular expression:
.* 14203+(21870110458)
Which two AS paths match? (Choose two.)

A.
27522 2187010458

B.
27522 14203 14203 14203 21870

C.
14203 21780 10458

D.
14203 21780 27522

Explanation:

## 8 Comments on “Which two AS paths match?”

1. jslaven says:

If the regular expression is: .* 14203+ (21870|10458) and there’s a pipe “|” between 21870 and 10458, then answer B and D.

0

0
2. Dylan says:

I also agree. B and C are correct

Definitions
. ==> One instance of any character except the space. For example, .456 matches 1456 or 6456.
+ ==> One or more instances of the immediately preceding term. For example, tre+ matches messages with tree or tread but not trough.
* ==> Zero or more instances of the immediately preceding term. For example, 234* matches 2345698 or 2347985

.*14203+ (21870 | 10458)

(.) Can begin with one instance of any character except space. Meaning it can begin with anything.
The Any Characters we chose in (*) is preceeding (*)

What determines the answer are these
Must have one or more instances of 14203 (Makes answer A wrong)
Then can have either 21870 or 10458 at the end (Makes answer D wrong)

0

0
3. miro312 says:

It should be: .* 14203+ (21870|10458)\$ and therefore B and C are correct.

0

0
4. testking502 says:

D is also incorrect as it doesn’t end with either 21870 or 10458. Only C is correct and matches.

0

0
5. testking502 says:

I’m smoking crack.

B is the only correct answer.

C ends with both 21870 and 10458. The “()” is an OR operator. It can’t match both.

0

0
6. testokhan says:

by playing left and right the only option gets the two results is:

.* 14203+ (21870|10458)\$

selecting three options:
1.Perform multiline matching

2. Perform a global match (don’t stop at first match)

3. DOT ALL. The dot (.) metacharacter matches any character INCLUDING line breaks.

A: 27522 2187010458
B: 27522 14203 14203 14203 21870

http://www.freeformatter.com/regex-tester.html

0

0