Mining for regular expressions from text

Hi all
I have a situation where I need to develop a set of regular expressions from lists.
I have lists of files uploaded and downloaded, and when the event happened. I need to analyze these and boil them down to a set of regular expressions.
The regular expressions will be used in the future to check the logs for activities. For example:
foo*.zip is downloaded every night. Has it been downloaded tonight.
I am looking for help in analyzing the lists of files and deriving regular expressions to describe them.
Any ideas?
Thanks all

check the url http://java.sun.com/developer/technicalArticles/releases/1.4regex/index.html

Similar Messages

  • Can somebody help me in getting some good material for Regular Expressions and IP Community list

    can somebody help me in getting some good material for Regular Expressions and IP Community list

    I'm not sure what you mean by "IP Community list", but here are 3 reference sites for Regular Expressions:
    Regular Expression Tutorial - Learn How to Use Regular Expressions
    http://www.regular-expressions.info/tutorial.html
    Regular Expressions Cheat Sheet by DaveChild
    http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/
    Regular Expressions Quick Reference
    http://www.autohotkey.com/docs/misc/RegEx-QuickRef.htm

  • Remove regular expression from a string

    Hello,
    I have a string like this
    @1test;'"{input+
    Please help me to remove special characters from the string.

A: remove regular expression from a string

Hi Krishna,
DATA : str TYPE STRING VALUE '@1test;"{}]input+',
            char,
            length TYPE i,
            index TYPE i.
length = STRLEN( str ).
WHILE length > index.
  char = str+index(1).
  WRITE char.
  if char CA '+-*/!`@#$%^&()_=[]{};'.               " Add/Remove here to include numbers
    REPLACE ALL OCCURRENCES OF char in str WITH ''.
    REPLACE ALL OCCURRENCES OF '"' in str WITH ''.  " characters "{}[] are not comparable
    REPLACE ALL OCCURRENCES OF '{' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '}' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '[' in str WITH ''.
    REPLACE ALL OCCURRENCES OF ']' in str WITH ''.
    length = STRLEN( str ).
    ENDIF.
  add 1 to index.
ENDWHILE.
WRITE str.
Add or remove special char from '+-*/!`@#$%^&()_=[]{};' in if part as per your requirement.
Hope it meets your requirement.
Do not forget to mark helpful/correct if ma answer is useful .
Thanks,
Karthik

Hi Krishna,
DATA : str TYPE STRING VALUE '@1test;"{}]input+',
            char,
            length TYPE i,
            index TYPE i.
length = STRLEN( str ).
WHILE length > index.
  char = str+index(1).
  WRITE char.
  if char CA '+-*/!`@#$%^&()_=[]{};'.               " Add/Remove here to include numbers
    REPLACE ALL OCCURRENCES OF char in str WITH ''.
    REPLACE ALL OCCURRENCES OF '"' in str WITH ''.  " characters "{}[] are not comparable
    REPLACE ALL OCCURRENCES OF '{' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '}' in str WITH ''.
    REPLACE ALL OCCURRENCES OF '[' in str WITH ''.
    REPLACE ALL OCCURRENCES OF ']' in str WITH ''.
    length = STRLEN( str ).
    ENDIF.
  add 1 to index.
ENDWHILE.
WRITE str.
Add or remove special char from '+-*/!`@#$%^&()_=[]{};' in if part as per your requirement.
Hope it meets your requirement.
Do not forget to mark helpful/correct if ma answer is useful .
Thanks,
Karthik

  • Getting the regular expression from the given text

    Hi
    I need to develope an application which can convert the given text into the regular expression. I need that when i enter any text in textarea that should be translated into regular expression in another panel. but i could not find the method or technique which can do so. plz help me to resolve this issue.
    Thanks Imran khan.

    well, there are an infinite number of regular expressions for an arbitrary piece of text, so you will have to qualify in your mind what the purpose of the regular expression is.
    For instance, it is trivial to create a regex for a string just by copying the input text, and inserting \ before any special characters. But this pattern would probably be quite silly.

  • Migrating Regular Expression from apache to Java1.4

    Did any one out there migrate from apache regular expressions to the new Java regular expressions? Are the two compatible? How much work is it to do this? What are the pitfalls? Are there any resources on this topic?
    Thanks,

    I did migrate some Jakarta regexp to java 1.4's. If ur old codes just used match() method to see if a string matches the pattern, then search/replace using any decent text edit could quickly migrate all of them. However, if you used lots of the Apache regexp's APIs, the fastest way is to write a wrap class for each class you used in the regexp pacakage, and use the new regexp package to implement all the Apach regexp APIs, then, the only thing you need to do is to replace the import statement to import those wrapper classes. I personally think this is the best and common way to migrate from an old API package to a new one.

  • Back reference for regular expressions on "Search & Replace".

    Can't I reference a result from my Regular Expression used on "Search Clause" into my "Replace Clause"?
    What I'm doing is:
    Using JDev 10.1.3 DP,
    Search Menu -> Replace in Files...
    Select "Regular Expressions"
    Text: (A[0-9]*?_)(.)
    Replace with: $2 (reference to the second Parenthesis in the "Text" Field).
    For example, in Java, I would so something like this:
    "Dummy String".replaceAll("(D.*? )(S)", "$2");
    Are there any other ways that I can just Search something and Replace for nothing? I need a simple "Search and Delete", you know?
    If I don't do that and try to leave it blank, a warning comes up saying that the "Replace with" field cannot be blank.
    Any sugestions?

    BOUNCE!
    Please, anyone?
    Will I really have to delete 1200 occurrences by hand???
    :(

  • Please recommend a good tutorial for Regular expressions?

    I have several PERL programs that I need to translate in to JAVA for performance reasons. Those programs heavily use Regular Expressions. I have an excellent knowledge about PERL Regular Expressions but know very little about Java Regular Expressions.
    So Can any one of you recommend me a good tutorial for Java Regular Expressions.
    Thankx In Advance
         LRMK

    Since you know regexs, the java.util.regex.Pattern class API is probably all you need, it pretty thoroughly documents Java's flavor, and the differences from PERL's flavor.

  • How to set keepalive check for regular expression

    Hi
    We are using css110501 CSS.
    Right now the keepalives on services are set using hash values.
    But i want to change this keepalives to implement keepalives with regular expression checking.
    Any Ideas?

    The CSS supports it's own native scripting language that can be used to write keepalives among other things.
    Here is an example of a script that I wrote to check a page for some specific text:
    ! Filename: ap-kal-statpage
    ! Parameters: None - must be coded in script
    ! Description:
    ! This script will attempt to connect to a host and
    ! "GET" an html page. The script checks the contents
    ! of the page for a particular string. If the string
    ! is found, the script passes.
    ! Failure Upon:
    ! 1. The correct arguments are not supplied.
    ! 2. The CSS is unable to connect to the host.
    ! 3. The string is not found in the page.
    no echo
    if ${ARGS}[#] "LT" "4"
    echo "Usage: ap-kal-portlist \'Hostname Port Page String ...\'"
    exit script 1
    endbranch
    set host "${ARGS}[1]"
    set port "${ARGS}[2]"
    set page "${ARGS}[3]"
    set string "${ARGS}[4]"
    set EXIT_MSG "Host ${host} not responding on TCP port ${port}."
    socket connect host ${host} port ${port} tcp
    socket send ${SOCKET} "GET ${page} HTTP/1.0\n\n"
    set EXIT_MSG "String was not found."
    socket waitfor ${SOCKET} "${string}" 200
    socket disconnect ${SOCKET}
    echo "String ${string} was found."
    no set EXIT_MSG
    exit script 0

  • ALC-FUT-001-007: Syntax error in the regular expression *. from File Utilities - Find in ES2

    Has anyone encountered the above error when trying to use the Foundation - File Utilities service Find?
    This is occuring in ES2, and I have tried using an asterisk, as well as the exact file name I know exists.
    I have tried literals in the Process Properties, as well as passing it in via string variables.
    Any help is appreciated.
    Thanks
    Mark

    Thanks for your response.
    Here is what we have learned:
    We should not put the regular expression value in single quotes - eliminates the error.
    The problem is, the Find operation always returns an empty list no matter what criteria we enter - even C:\ with criteria = *.*
    ES 2 is running on a Windows 2003 machine.
    Thanks Again
    Mark

  • Java parser for regular expression to java program

    Hi All,
    I am very new to parser technologies .I am looking for a (java)parser which can read the "regular expression" and can convert it into "java program".Please let me know is there any thing related to this.
    Thanks in advance.
    Your will be appriciate.
    Regards,
    Sai.

    Hi Jos,
    Thank you for your quick response .You're welcome.
    If you have any sample code or simple example for how to use those
    classes (Pattern,Match) ,will you please send me .It will be helpful for me.Jverd gave you two nice links already in his reply #3
    If there is any "open source" for parsering regular expressions.
    Please send me I am very new to parser technologies.Note that that Pattern class take care of all the parsing of REs, i.e. there's
    nothing 'interesting' left for you to do any parsing whatsoever. Can you
    elaborate a bit on what you exactly want to do and learn?
    kind regards,
    Jos

  • Validation for regular expressions special characters in java

    Hi,
    I need to validate an user name field to an application while creating that. It has to contain only alpha numerics. can you give me the regular expression and also how to implement that.
    thanks,
    VJ

    Do your own work. Look up the documentation on Pattern and make an attempt at validating a String yourself. Then worry about implementing a GUI on top of that.

  • Regular Expressions from C++ to Java

    Does anyone know if it is possible to use the same regular expressions used in C++ with in Java? Here it is a regular expression used in a C++ program:
    ^[[:digit:]]{4}$"I did a test, but it does not work. It always evaluate to false.
    Thanks,
    Sid

    Does anyone know if it is possible to use the same
    regular expressions used in C++ with in Java? C++ doesn't have regexes, so presumably you are using a library (and noting that might help.)

  • Replace a string using regular expression from powershell

    I want to replace the following:
    'browserName': 'firefox'
    with :
    'browserName': 'chrome'
    then I tried this:
    (get-content $conffile) -replace "^('browserName': ')\S+","browserName': 'chrome' |set-content $conffile
    But nothing happened.
    Could someboby tell me how to write the regular expression here? Thanks a lot.

    Second person today with the same question.
    get-content $conffile |%{$_ -replace "'browserName':\s+'firefox'","'browserName': 'chrome'"  | set-content $conffile
    \_(ツ)_/

  • How do you configure the a network for Airport Express from a PC computer

    A friend let me borrow her Airport Express so I could have wireless, but I can't figure out how to set up the network from my PC computer. She just gave me the device without any accompanying instructions or software.  The intructions online only explain how to setup the network using an Apple product.  How can it be done from a PC?

    Use the same instructions and the Windows version of AirPort Utility:
    AirPort Utility 5.5.3 for Windows

  • Regular expressions in JavaScript for CP5?

    I'm having trouble implementing a regular expression from within the JavaScript window. First of all, does CP 5 support regular expressions?

    On slide 1 I have a Text Entry Box, (called TheTeb) with a Submit button. TheTeb has variable associated with it called TypedText.
    In the box, the user may type anything.
    On slide 2 there is a caption.
    The caption must show the text that the user typed  into TheTeb but filtered so that only the letters, numbers, and spaces can be shown.
    For example,
    if the user types:           123 & abc /DEF
    the caption will show: 123 abc DEF
    This requirement is represents the behavior of an application that I am simulating, so I don't want to change the interaction in any way.
    My strategy is to use 2 different variables, one for the text entry box (TypedText), the other for the caption (FilteredText). I can add JavaScript to the On Enter event of slide 2. The script will Get the TypedText, pass the TypedText to FilteredText, and run a regular expression somewhere so the filtered text displays on slide 2.
    Here's the script so far:
    var objCP = document.Captivate;    
    var ScriptTypedText = objCP.cpEIGetValue('TypedText');
    function ReturnValue(){    
      objCP.cpEISetValue('FilteredText', ScriptTypedText);
    ReturnValue();
    The script works as is. The user types text on slide 1 (as TypedText), presses Enter and the text shows up on slide 2 (as $$FilteredText$$). Obviously, the trouble is, I don't know where to add my regular expression into the JavaScript so the text actually gets filtered. Do I make a new function?
    By the way, a sort of pseudocode syntax for the expression would be:
    FilteredText = TypedText.replace(/ /g,"");

  • Maybe you are looking for

    • Cannot email photos from iPhoto

      I have just installed a whole load of updates and iPhoto didn't work so I re-installed from my iLife 11 disc.  I had to update the software before it worked.  So far so good. Sadly when I click 'share' in order to email a photo, despite having select

    • Allowed Mozilla to upgrade to 9.0.1 . . . I used to be able to display all my bookmarks, all the time, in a sidebar . . . lost that functionality.

      Not sure what more I can add . . . before I updated to 9.0.1, I had all my bookmarks displayed in a side bar, all the time . . . I have lost the ability to have that functionality.

    • Time machine and an external hard drive

      Hello Should the external hard drive (that I'm using Time Machine for) be left in the iMac all the time? Or should I be removing it incase it re-writes over itself? All guidance accepted  Peter

    • Optical audio output cuts out

      I searched for some answers to this and didn't find any. I didn't even find any reference to the same problem. I have a PowerMac G5 Dual 2.7GHz and running 10.4.9. I need to get digital audio from my G5 to my theater in another room. I bought an opti

    • Front row - black screen with audio

      I recently installed Leopard on my old iBook. When i start Front row, I can see the menus , trailer list, movie list etc., but when i play anything, the screen goes blank, i can see a progress bar moving(which auto-hides), and audio is also OK, but t