Vijay
Vijay

Reputation: 67299

what does this regex mean "[^>]*

I came across some regex's and this thing got me confusing! i am not able to understand what exatly it means:

[^>]*

could anypne please tell me.

Upvotes: 3

Views: 160

Answers (4)

cjds
cjds

Reputation: 8426

Characters in the Language can repeat any number of times except for >.

^ is an indicator of exclusion.

* is an indicator of repetition

[^>]*

Anything except > can repeat

Upvotes: 1

Mrinmoy Ghoshal
Mrinmoy Ghoshal

Reputation: 2834

This Pattern will Select anything except >

Upvotes: 0

nhahtdh
nhahtdh

Reputation: 56829

Match 0 or more characters, which are not >. The ^ as the first item in character class [] will make the character class a negated character class, and any character after ^ are excluded.

Upvotes: 6

mvp
mvp

Reputation: 116437

This means any character except for > repeated any number of times.

Upvotes: 2

Related Questions