Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
can you give an example of string it needed to match against? :)

Sure, but off topic I think. It was for using in an .slrn-score file (slrn is the news reader I use). I wanted to give -100 points to posts that where sent to some es.comp.os.linux.* group and to other group outside that hierarchy.

[es.comp.os.linux.*] Score:: -100 ~Newsgroups: ^es\.comp\.os\.linux {: Newsgroups: ^es\.comp\.os\.linux Newsgroups: ,([^e]|e([^s]|s([^\.]|\.([^c]|c([^o]|o([^m]|m([^p]|p([^\.] +|\.([^o]|o([^s]|s([^\.]|\.([^l]|l([^i]|i([^n]|n([^u]|u[^x]))))))))))) +)))) }

(Yes, it seems it isn't exactly the same regex; in my previous post I copied and pasted from another file). I won't explain the whole file format but roughly, the first line means we're working with messages in e.c.o.l.* groups. The "~Newsgroups" line means that messages whose Newgroups: field didn't match ^es\.comp\.os\.linux would be scored with -100 points (since if they don't match and are in ecol, they are crossposts). Alternatively, the following block says that messages with a Newsgroups: line that matched ^es\.comp\.os\.linux and matched some other thing (for example, Newsgroups: es.comp.os.linux.misc, alt.some.other), would also be scored.

--
David Serrano


In reply to Re^3: The craziest RegExes you ever created by Hue-Bond
in thread The craziest RegExes you ever created by Ieronim

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2021-10-20 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (79 votes). Check out past polls.

    Notices?