Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

What does this command do?

grep "<[^>]*>" inuux.xml

What is searching for?

share|improve this question
    
Also about this command grep "<[^>/]*>" –  el ab Oct 17 '11 at 3:18
add comment

1 Answer

up vote 8 down vote accepted

It can be explained like this:

<         # A literal "<" character
[^>/]*    # Anything that isn't a ">" or a "/", zero or more times
>         # Followed by a literal ">" character

Presumably, this is for matching XML/HTML tags. It certainly isn't the best regex in the world, but it's quick, dirty, and probably works.

share|improve this answer
6  
Parsing HTML with regular expressions -- always a good decision –  Michael Mrozek Oct 17 '11 at 6:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.