My Regular Expression is not replaceing lines with br / in them

here is my problem
This is my original Code:
<p class="x3-subheading-1">DEGREE: Bachelor of Accountancy<br />MAJOR: Accounting</p>
I want to find and replace all instances of this subheading class with this:
<h3>******************</h3>
This is what has worked for me for ones without <br />:
Find:           <p class="x3-subheading-1">([^<]*)</p>
Replace:      <h3>$1</h3>

Managed to figure out this as a work arround.
Find:          <p class="x3-subheading-1">([^<]*)<br />([^<]*)</p>
Replace:     <h3>$1<br />$2</h3>
Depending on the number of <br /> you can just add more
Find:          <p class="x3-subheading-1">([^<]*)<br />([^<]*)<br />([^<]*)</p>
Replace:     <h3>$1<br />$2<br />$3</h3>

Similar Messages

  • Help with regular expression to not run shtml-hacktype on particular reqs

    Hi,
    Okay, back to 7.0 u2 not ignoring things it should. Our regular site has a lot of SHTML includes. Then we have the glassfish loadbalancer plugin configured for a back-end web application. The problem is, the application URLs end in .html and the web server is looking locally for those requests. If I disable:
    ObjectType fn="shtml-hacktype"In the instance obj.conf, then the requests process normally in the proxy.
    I can't do that, though, because of the includes - then our main site doesn't function properly.
    Is there a way I can surround that line with something like "if request is not /gog/*" then execute? Similar to what I had to do for the j2ee problem looking locally instead of on the back end Weblogic servers.
    <If $uri =~ '^/wp-(.*)'>
    NameTrans fn="ntrans-j2ee" name="j2ee"
    </If>Only I want the opposite - if $uri is not equal to '^/gog/(.*)' then execute the shtml hacktype. I just don't know exactly what the expression would be.
    Thanks!

    Nevermind - I got it. RTFM :-)
    <If $uri !~ '^/gog/(.*)'>
    ObjectType fn="shtml-hacktype"
    </If>

  • "Multiple Line" Regular expressions in find/replace

    Hi there,
    I'm wondering if it is possible to find and replace (in batch
    mode) the following obstacle:
    say is have this piece of code in every html file i'd like to
    edit:
    <html>
    <blah blah (Same text in all files)>
    <blah blah (NOT same text in all files)>
    <blah blah (NOT same text in all files)>
    <code that is the same again in all files>
    and would like to replace it by nothing, effectively deleting
    the part completely... (by leaving the replace by field empty).
    The tricky part is that the lines which are NOT the same in
    all files, are sometimes 2 lines, but sometimes 3 or more lines.
    Somehow I need to get the regular expression to include
    <line>* (or something similar), in order to make the regular
    expression work.
    Any ideas on how to solve this? I must say untill now, the
    Dreamweaver search and replace function has been the most effective
    one, compared to many alternatives out there.
    Rp

    I've tried \1 and $1Just these in the text items of the find & replace dialog box...?????
    Can you write down exactly what have you tried....(text to be replaced by which....)????
    Greetings....
    Sim

  • Regular Expression Find and Replace with Wildcards

    Hi!
    For the world of me, I can't figure out the right way to do this.
    I basically have a list of last names, first names. I want the last name to have a different css style than the first name.
    So this is what I have now:
    <b>AAGAARD, TODD, S.</b><br>
    <b>AAMOT, KARI,</b> <br>
    <b>AARON, MARJORIE, C. </b> <br>
    and this is what I need to have:
    <span class="LastName">AAGAARD</span>  <span class="FirstName">, TODD, S. </span> <br />
    <span class="LastName">AAMOT</span> <span class="FirstName">, KARI,</span> <br/>
    <span class="LastName">AARON</span> <span class="FirstName">, MARJORIE, C.</span> <br/>
    Any ideas?
    Thanks!

    Make a backup first.
    In the Find field use:
    <b>(\w+),\s+([^<]+)<\/b>\s*<br>
    In the Replace field use:
    <span class="LastName">$1</span> <span classs="FirstName">$2</span><br />
    Select Use regular expression. Light the blue touch paper, and click Replace All.

  • Aiport Extreme and Airport Express are not working together with DSL

    My 2wire modem failed and I have replaced it with a basic actiontec dsl modem. I have my airport extreme connected to the actiontec via ethenet cable. All is working. Internet access through the actiontec is working and internet access through the extreme is working. What I cannot for the life of me remember how to do is get my express to work as a range extender for airport extreme.
    The extreme is set up in Ethernet not PPPoE mode which might be the issue, but I can't remember the right settings (IP ranges, etc) if I set it up in PPPoE mode.
    Net - my network that was working DSL modem to Extreme to Express as a range extender no longer works at the Express end. And don't even get me started about AT&T tech support. Help smart guys/girls out there - I know this is something simple that I should have written down when I first set up my network...

    shakeelium wrote:
    Good People,
    I have an Airport Extreme serving as my wireless router with an external hard drive connected to it.  I also have an Airport Express in another room connected to a stereo for Airplay.  Neither can be found on the Airport Utility (v5.5.3), but wireless internet still works.  This happens often, with both reappearing in Airport Utility for short amounts of time periodically.
    I've once had the same problem.
    The reason for that issue is the frequency (radio band) hopping of the station.
    On your AP-Extreme
    Enter the manual setup
    Disable Guest Network if not desperately needed
    Set a dedicated name for the 5GHz wireless (wireless -> wireless options)
    Eventually change the radio mode (if no 802.11b/g systems in your home) to "only 802.11n (5GHz) - only 802.11n (2.4GHz)" by holding down the option key *alt* while clicking on the drop down.
    On your Mac
    Disable (switch off) wireless
    Enter system configuration -> network -> wireless
    Uncheck "Ask to join new networks"
    Enter advanced options and check that your wireless name is in the first position of the list. If not, drag it with the mouse to the first position.
    Click apply
    Join your wireless again and try to connect to the 5GHz name (SSID) because the 5GHz will improve the connection speed of your Mac remarkably.
    Eventually you might change the settings on the Express too.
    Check the location of the AP-Extreme.
    It should NOT be placed: On the floor, in a corner, behind furniture, near metal objects, life high voltage wire or cordless phone bases.
    It should be placed: As high as possible (up on a shelf or ceiling mounted) with a maximum line of sight to all stations, even thru walls.
    If your home situation allows that, try to use the 5GHz band only. If you own a iPhone this must use the 2.4GHz radio.
    Lupunus

  • Regular Expressions find and replace

    Hi ,
    I have a question on using Regular Expressions in Java(java.util.regex).
    Problem Description:
    I have a string (say for example strHTML) which contains the whole HTML code of a webpage. I want to be able to search for all the image source tags and check whether they are absolute urls to the image source(for eg. <img src="www.google.com/images/logo.gif" >) or relative(for eg. <img src="../images/logo.gif" >).
    If they are realtive urls to the image path, then I wish to replace them with their absolute urls throughout the webpage(in this case inside string strHTML).
    I have to do it inside a servlet and hence have to use java.
    I tried . This is the code. It doesn't match and replace and goes inside an infinite loop i.e probably the pattern matches everything.
    //Change all images to actual http addresses FOR example change src="../images/logo.gif" to src="http://www.google.com/../images/logo.gif"
              String ddurl="http://www.google.com/";
    String strHTML=" < img src=\"../images/logo.gif\" alt=\"Google logo\">";
    Pattern p = Pattern.compile ("(?i)src[\\s]*=[\\s]*[\"\']([./]*.*)[\"\']");
    Matcher m = p.matcher (strHTML);
    while(m.find())
    m.replaceAll(ddurl+m.group(1));
    what is wrong in this?
    Thanks,
    Rajiv

    Right, here's the full monte (whatever that means):import java.util.regex.*;
    public class Test1
      public static void main(String[] args)
        String domain = "http://www.google.com/";
        String strHTML =
          " < img src=\"images/logo.gif\" alt=\"Google logo\">\n" +
          " <img alt=\"Google logo\" src=images/logo.gif >\n" +
          " <IMG SRC=\"/images/logo.gif\" alt=\"Google logo\">\n" +
          " <img alt=\"Google logo\" src=../images/logo.gif>\n" +
          " <img src=http://www.yahoo.com/images/logo.gif alt=\"Yahoo logo\">";
        String regex =
          "(<\\s*img.+?src\\s*=\\s*)   # Capture preliminaries in $1.  \n" +
          "(?:                         # First look for URL in quotes. \n" +
          "   ([\"\'])                 #   Capture open quote in $2.   \n" +
          "   (?!http:)                #   If it isn't absolute...     \n" +
          "   /?(.+?)                  #    ...capture URL in $3       \n" +
          "   \\2                      #   Match the closing quote     \n" +
          " |                          # Look for non-quoted URL.      \n" +
          "   (?!http:)                #   If it isn't absolute...     \n" +
          "   /?([^\\s>]+)             #    ...capture URL in $4       \n" +
        Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE | Pattern.COMMENTS);
        Matcher m = p.matcher(strHTML);
        StringBuffer sbuf = new StringBuffer();
        while (m.find())
          String relURL = m.group(3) != null ? m.group(3) : m.group(4);
          m.appendReplacement(sbuf, "$1\"" + domain + relURL + "\"");
        m.appendTail(sbuf);
        System.out.println(sbuf.toString());
    }First off, observe that I'm using free-spacing (or "COMMENTS") mode to make the regex easier to read--all the whitespace and comments will be ignored by the Pattern compiler. I also used the CASE_INSENSITIVE flag instead of an embedded (?i), just to remove some clutter. By the way, your second (?i) was redundant; the first one would remain in effect until "turned off" with a (?-i). Another way to localize a flag's effect by using it within a non-capturing group, e.g., (?i:img).
    As jaylogan said, the best way to filter out absolute URL's is by using a negative lookahead, and that's what I've done here. The problem of optional quotes I addressed by trying to match first with quotes, then without. The all-in-one approach might work with URL's, since they can't (AFAIK) contain whitespace anyway, but the alternation method can be used to match any attribute/value pair. It's also, I feel, easier to understand and maintain. Unfortunately, it also means that you can't use replaceAll(), since you have to determine which alternative matched before doing the replacement, but the long version is still pretty simple (especially when you can just copy it from the javadoc for the appendReplacement() method, as I did).

  • 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???
    :(

  • Match Regular Expression does not match what Match Pattern does

    I have read through a lot of posts about how Match Pattern does not match what Match Regular Expression will due to not processing some characters.
    However, I found a problem with the other way. A simple Reg-Ex that works in Match Pattern but not Match Regular Expression.
    What I have here is just an example. I want to use Match Regular Expression so I can specify some sub-matches.
    The reg-ex is for: one or more non-numeric characters, a space, one or more numeric characters. At the start of the string.
    How can I get this working in Match Regular Expression? I am working in LabVIEW 2010f2 32 bit. Here is the code snippet and the results:
    Rob
    Solved!
    Go to Solution.

    Robert Cole wrote:
    I think I prefer the ~ for negation since ^ is also used for beginning of the string. But we work with what we have.
    Let me offer you a tip and perhaps defend the honor of the regex a little bit.  One of my favorite features of regexes is the ability to specify character classes (and their negation).  One of the reasons I have to think about the ~ versus ^ is that I rarely use ^ in a regex alternative. 
    Some examples:
    [0-9] = \d (digit)
    [^0-9] = \D (not a digit)
    The equivalent regex for your case is: \D+ \d+

  • Regular expression does not execute runtime

    Hello adobe collegue's,
    I am currently stumbling on a strange issue regarding javascript embedded to compress a string:
    // main function to compress any string, removing all non-word characters and making the string all lowercase
    function compressString(input){
        var patt=new RegExp("\\W","g");
        patt.compile(patt);
        var output = input.toLowerCase().replace(patt,"")+"YESS";
        return output;
    Somehow this code does execute perfectly while previewing in adobe designer 9.0.0.2 but runtime all javascript does execute except for the part mentioned above.
    I know this part is executed because in the result i see the string "YESS" added to the response of this function.
    Somehow the pattern is not compiled, or executed runtime...
    I also tried more simple regular expressions but none of them actually worked.
    For the templates the option client is set where to execute the javascript, although while testing the options to solve the issue is also tried settings both and server. None provided the solution.
    Can someone provide any help...it's appreciated!
    Thanks,
    Marcel

    Hi,
    you can make your function more simple.
    function compressString(input){
              return input.toLowerCase().replace(/\W/g,"") + "YESS";

  • Regular expression does not work in IE

    Hi,
    I'm having a regular expression which should check the content of an inputText field: it should contain a number, a character and the size should be at least 6. It's working when I test it in FireFox but it always fails to succeed in IE:
              <af:inputText>
                <af:validateRegExp pattern="^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]{6,24}$"
                                   noMatchMessageDetail="Does not match."/>
              </af:inputText>How comes it does not work in IE (6.0)?
    JDeveloper 10.1.3.3
    Thanks in advance,
    Koen Verhulst

    hi Koen
    The web page you refer to ...
    http://www.fileformat.info/tool/regex.htm
    ... seems to be doing server side Java regular expressions (and as such will behave the same in both FF and IE).
    The af:validateRegExp component you want to use does client side evaluation of the regular expression, using scripting, hence the apparent difference between FF and IE.
    There is also this web page ...
    http://www.regular-expressions.info/javascriptexample.html
    ... that seems to behave similar to the markup and scripting resulting from the af:validateRegExp component.
    Besides the value "2abcdef" there seem to be others that are accepted by IE for the regular expression "^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]{6,24}$", values like these:
    "a2abcdef", "a2abcde", "abcdef2abcde", "2a3cdef", "2a34567"
    Although these values are not accepted by IE (but are accepted in FF):
    "2abcde", "23bcdef"
    success
    Jan

  • Regular expressions-how to replace [ and ] characters from a string

    Hi,
    my input String is "sdf938 [98033]". Now from this given string, i would like to replace the characters occurring within square brackets to empty string, including the square brackets too.
    my output String needs to be "sdf938" in this case.. How should I do it using regular expressions? I tried several possible combinations but didn't get the expected results.

    "\\s*\\[[^\\]]+\\]"

  • Exception thrown as regular expression is not recognized

    Hi all,
    My code throws me an exception, telling me that there are no files matching my file pattern, but I have three files which should match the file pattern in my input folder: /home/rkuite/test/asnout/store/ . There are three files there: ASN00507.txt, ASN00512.txt and ASN00531.txt
    My code looks like this:
    [outputtostore jcaps code|http://www.risa-webdesign.nl/jcaps_code/jcd_outputtostore.TXT]
    And the error I get is as follows:
    [error message when I execute the code|http://www.risa-webdesign.nl/jcaps_code/error_message.TXT]
    I have tried various options and things to resolve this but to no avail, so I'd like to ask your help: what is wrong with the code?
    Thanks & Kind Regards,
    Richard

    The error message:
    java.io.FileNotFoundException: Directory Name: /home/rkuite/test/asnout/store/ File name: ^ASN*--- End of nested exception.
    Is telling you that no files exist that begin with AS followed by zero or more N's. I believe the following regular expression would work better:
    ^ASN[0-9]*\.txt$
    This would match any file name that began with ASN and was followed by zero or more digits zero thru nine and then ended with the dot txt.
    Regards,
    AK~

  • Regular Expression functions not supported in Interactive report filters ??

    I'm using APEX 4.0.2 and I'm trying to create a row filter in an interactive report which uses regexp_instr and regexp_replace functions and I'm getting the message:
    Invalid filter expression. regexp_instr
    The code runs fine in SQL Workshop
    select cytogenetics from z_patient
    where regexp_instr(regexp_replace(cytogenetics,'(\,+|\"+|\s)',''),'(^46XX$|^46XY$|^46XX\[..\]$|^46XY\[..\]$)')=1
    CYTOGENETICS
    "46,XX [20]"
    "46,XY[20]"
    "46,XX"
    "46,XY[20]"
    "46,XY[30]"
    "46,XY[26]"
    "46,XY [33]"
    "46,XX[32]
    etc...
    my filter is just the where clause above i.e.
    regexp_instr(regexp_replace(cytogenetics,'(\,+|\"+|\s)',''),'(^46XX$|^46XY$|^46XX\[..\]$|^46XY\[..\]$)')=1
    *Are regular expression functions just not supported in interactive report filters?*
    thanks in advance
    Paul P

    Hi Paul,
    regular expression functions are supported in interactive report filters, but it looks like that REGEXP_INSTR hasn't been added as valid command. Only REGEXP_SUBSTR and REGEXP_REPLACE are valid commands for computation expressions and REGEXP_SUBSTR, REGEXP_REPLACE and REGEXP_LIKE for row level filters.
    I have filed bug# 12926266 to fix this issue. Sorry for the inconvenience.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Regular Expression + Find and Replace

    Hey there-  I have a question about regExp and the Find and Replace.  Basically I want to search a wildcard between a href tag, how would that look, because the code below does not work.
    countryLink = "<a href=\"http://www.whateve.com\" target=\"_parent\">";
    [code]
    countryLink = "([^"]*)";
    [code]
    Thanks! Any help is appreciated!
    Also, how do i add code blocks to this forum?

    Yes, I meant the <a> tag, but thank you for displaying the href attribute solution as well.  This solved my issue.  Thanks!  Thought I would display what I did with your code incase someone was interested in using this code to convert a javascript string to XML.
    query this:
    countryLink = "<a href=\"http://www.whateve.com\" target=\"_blank\">";
    add this to the Find box:
    countryLink = "<a href=\\"([-\w:/.?=&;]+)\\" target=\\"_parent\\">";
    add this to the Replace box:
    <countryLink>$1</countryLink>
    creates an output of this:
    <countryLink>http://www.whateve.com</countryLink>

  • Regular Expression -- Did Not Find Successfully

    I ran a test: to find a piece of text "Bill" in a letter. This letter is in MS Word format. I am certain that "Bill" is in the letter. My simple java program compiled and ran (java MatchingText). However, I did not get "A match is found", which is the message specified in the System.out.println, to the console.
    Here is my code:
    import java.util.regex.*;
    import java.io.*;
    public class MatchingText {
    public static void main(String[] args) throws Exception {
    File fin = new File("c:/javaprj/letter.doc");
    //Open an input stream
    FileInputStream fis =
    new FileInputStream(fin);
    BufferedReader in = new BufferedReader(
    new InputStreamReader(fis));
    String input = "Bill";
    // Create a pattern to match input
    Pattern p = Pattern.compile("input");
    Matcher m = p.matcher(input);
    if (m.find()) {
    System.out.println("A match is found"); }
    in.close();
    Could someone points out my mistake? Thanks.

    There were mistakes in my program. I fixed some of the mistakes and I could see improvements in the output. Yet, I am not quite there:
    when there is no match in the source document, the code outputs "Found A Match" twice to the console.
    When there is "one" match in the source document, the code outputs "Found A Match" three times to the console.
    When there are "two" matches in the source document, the code outputs "Found A Match" four times to the console.
    When there are "three" matches in the source document, the code outputs "Found A Match" five times to the console.
    and so on.
    Just wonder where those two extra "Found A Match" come from.
    code:
    import java.util.regex.*;
    import java.io.*;
    public class MatchingText {
    public static void main(String[] args) throws Exception {
    //String provided by the user
    String userInput = "Bill";
    File fin = new File("c:/javaprj/letter.doc");
    //opens a bufferdReader to read lines
    BufferedReader in=new BufferedReader(new FileReader(fin));
    try {
    while((userInput = in.readLine()) !=null) {
    //pattern in the source document
    String targetText = "Bill";
    //Create a pattern to match input
    Pattern p = Pattern.compile(targetText);
    //To find a match in each line
    Matcher m = p.matcher(userInput);
    while (m.find()) System.out.println("Found A Match");
    catch(IOException e){System.out.println("Error occurred while reading!");}
    //close the streams
    finally {
    try {
    in.close();
    catch(IOException e){System.out.println("closing file exception");}
    --------------------------------------------------

Maybe you are looking for

  • Logical standby as read only

    we are using 3 node RAC in 10g R2 and we have been requested to create one physical(for DR) and one logical standby(for reporting) for the primary database.we created both successfully. everything worked fine until i opened the logical standby databa

  • Portal integration with Exchange SSO issue

    Hello, We are using NW04s EP 7.0 SP16 and Exchange server 2003. We are trying to perform OWA and Groupware integration. Both the servers are in the same domain. The latest Kerbmap filter is configured in the Exchange back end server. Everything works

  • Unlocked bios?

    hey guys! i need some help with and if its posible to overclock my intel CPU and card.First some system info: Windows 8.1 64Bitsintel Core i7- 3632QM 2,2 Ghz(gets to 3,2Ghz in turbo boost)8GB DDR3 memory 789Ghz3GB SDHC Readyboost CardHP 1842 U3E1 Mot

  • An error has occurred during an attempt to access a device database record (Bold 9900)

    I've got this error messages and both my desktop and device software are updated. Does anyone know how to fix this? Tks!

  • SecurityException: Cannot set up certs for trusted CAs

    I'm pressed for a solution to meet a delivery deadline - any help would be appreciated. I have a method that requests an instance of a SecretKeyFactory. The method works in a standalone application and in JRun which we use for development but when i