Regex question - text url conversion

I am using the following regular expression to convert strings of text in < a href > links when viewing a text file on the web.

(document.body.innerHTML=document.body.innerHTML.replace(/(http:///\/)(.*) \s/gi, ' < a href = $1$ 2 > $1 2 < /a > < br / > '); in the body tag onLoad attribute.

I also want to use the same regular expression with the function rereplace on the content text file so that the text links appear as links in the RSS feed I created. I tried to do what follows didn't work and I'm not very good with regular expressions. I was wondering if someone could remember where I'm wrong.

< cfset bbcontent = ' #REReplace ("' #bbcontent # ', ' / (http:///\/)(.*) \s/gi", ' < a href = $1$ 2 >$ $1 2 < /a > < br / > ', 'ALL' ") #' >

\1\2
", "ALL")>

Notes:

-too many quotes and # s (inside the cfset in 99% of cases you don't have

need to use #);

-(*) - take everything until you reach the first space;

-in ColdFusion backreferences are with \1,\2...

-/ g is given by the fourth parameter ('ALL');

-/ i there are different functions for case and case

insensitive matches.

Mack

Tags: ColdFusion

Similar Questions

  • [JS] [regex] Question autour forming a regex

    Hello.

    I'm trying to use a regular expression to filter the non-url characters and replace them with % 20.  I have this line:

    myChangedError = myErrorText.replace(/[-\w\.@\\]/g,"%20"); but it does not work.

    I'm new on using Regex and want to know more, but this seems pretty basic, and I should be in this!

    Can anyone help?

    Thank you very much

    Roy

    A mistake, what is that supposed to do regular expression? Maybe you wanted to use /[^\w\.@\\]/ instead of /[-\w\.@\\]/?

    (Your question would be also much clearer if you were specific - what is an example of a character who is treated wrongly. What are you waiting for and what happened?)

    In General, if you are worried about security, you should explicitly include the characters, not blacklist some that seem dangerous to you. Being generally more dangerous than you know.

    You can also find more useful using encodeURIComponent (myErrorText) or maybe encodeURI (myErrorText), according to what it is you want to do. [What do you want?]

  • Read the question text

    Hello, I've attached all the images needed and screw/chopsticks.

    Question: I'm checking my text of reading/writing (what is written errors in an XML format, but also a corresponding timestamp) right after that I wrote the error in the XML file.  The code does is to make sure that the error is not a mistake I am allowing, then goes to write the error in the XML.  There is a box structure which then manages a first time entry.  The idea is to review the data from the XML, then insert the new error in the table and then write back in the xml doc after flattening.  I understand the issues in the long term this 'solution '.  Now, please don't comment on it.  What bothers me, is that when I try to re - open and read the document, I can't seem to ever display element of the array, even if the read/write function (which is essentially the exact same thing) can do it very well.  I circled the items.  The code is in 2011.  Be sure to insert text in the name of the document.  Run it a couple of times and I think you'll see what I'm driving at.  Anyone have an explanation for it?

    Open your base to replace file read and ends with reading XML file and Write functions, and I think it will work in the desired manner.

    You must use XML reading and writing files functions to serialize the data in a way that LabVIEW can reconstruct the table clusters and timestamps.

    http://zone.NI.com/reference/en-XX/help/371361H-01/Glang/read_from_xml_file/

  • Another RegEX question

    Hi, I have a question about the regular expression: If you look at the attached code you will find two examples. It is an old piece of code, but now I have to fix a bug that was discovered after a few years of use. Task: If the entry is for example C1 - C4, the algorithm needs generate a table of C1, C2, C3, C4. This should work on any digit and letter. Examples: R1 - R5, K569-K799, S2 - S3. This works very well for [letter] [number], but my regex won't work for the case now, I have to solve. If the entry is C1A1-C1A4 the output should be C1A2 C1A1, C1A3, C1A4, but I don't know what should look like the new RegEx so that it still works on [letter] [number] [letter] [number].

    You can not only use [0-9] + $ to return only the number of the end of the string?

    Regular correspondence Expression.vi will return all the foregoing the final number in 'before the game '.

    I'm sorry that I can't look at your code since I don't have a LabVIEW 2011 on my system.

    Rob

  • BlackBerry Smartphones BLACKBERRY CURVE3G QUESTION TEXT

    Is it possible to delete several text messages and send at the same time?  I would be grateful for any help at all.

    Hello and welcome to the Support Forums of community BlackBerry.com.

    Yes

    In the message list, place you on the first of many messages you want to delete, press on and hold the SHIFT key while scrolling upwards or downwards to highlight more adjacent messages. Press the DELETE key (or Menu > delete).

    You can also scroll over any separator date header bar and press Menu > delete prior and all messages before this date will be deleted.

    Here are some resources that you might enjoy:

    BlackBerry, frequently asked Questions

    BlackBerry 101

    BlackBerry Tips and tricks

  • Images placed behind text in Word 2010 are proposed to cover the text after conversion to PDF.

    System Specs:

    Windows 7, Word 2010, Acrobat XI

    I've highlighted several paragraphs thoughout the book I write by placing an image behind them. These images are set to display behind the text, leaving the readable text. So the image offers a sort of background for these select paragraphs.

    They look great in Word 2010.

    And the PDF looks a lot when I exported from Word 2007 using Acrobat 9 (at least I think it was 9...).

    But now, when I convert it to PDF using Word 2010 and Acrobat XI, the image is moved in front of the text; obscuring her completely.

    We never saw it? Any suggestions?

    EDIT - to be clear, I do the conversion using the PDF what acrobat tools puts in Word when it is installed.

    Here's how Adobe level 2 support 'resolved' for us: uninstall all instances of Acrobat on your system. If you have another version of Acrobat (if reader, Standard or Pro) installed, purge your system of all the tips of it in the Program Files folders and clean the registry of all guides in Acrobat. In my case, I use Adobe Application Manager because I now have CS6 installed, so installed Acrobat XI of MAO by clicking on "Try". It is installed and then I installed 11.0.1 update and then activated using my product key. I really think that the problem was that I didn't install PDF Maker during the original installation, because it was such a slug and buggy to who. When I installed by the above, I had not given the choice, so now I have Acrobat or Adobe tabs on all my Office applications, oh joy. But printing to PDF works as it should. As I was directed by rein through most of the above, I have no idea what has been really effective on the above. I tried to just uninstall Acrobat and resettlement on a system on which no other version of Acrobat had already been installed, but on which install the original XI of Acrobat didn't understand the PDF Maker and who had the symptoms of printing of this thread. This doesn't solve the problem, but do the relevant parts of the steps I have indicated above, did the trick. I have 20 users with XI Acrobat installed; Some have this symptom, some don't. I have not analyzed to see what is the common point, but this problem and its solution still seems very rickety for me.

  • How to avoid that 100% black text under conversion to treat black saving PDF of AI (CS4)?

    I save a PDF of Illustrator CS4 which contains only 100% black text. Print my provider tells me that the text in the PDF file has been converted into 4 c, dark black. I tried all different settings of creating PDF (high quality, quality defect, PDFX3, press) from Illustrator, but nothing is. How can I create a PDF file that maintains 100% black and prevents to convert to the black process?

    works very well here and I can't reproduce your problem. CS5, Windows 7

    Test by creating a new document in CMYK color mode. Creation of a few boxes with a different amount of k. as 32% 50% 75%. Save as PDF with default preset (default Illustrator) and once again with the high quality print preset. Open the pdf in Acrobat files, go to advanced > print > overview of the release and place the cursor on the gray boxes, color values read the same thing in Illustrator - no conversion has been applied.

    That you get different results when you perform this test?

  • Question text Edition

    How can I find what font is used in an existing document, I need to change the text in?

    My apologies for the imprecision of the question:

    Adobe Illustrator noob, have open a .ai file my boss of the edited text wants in and would like to know how I can find out what are the existing text is written in so I can make some adjustments.

    Pikaria,

    ... opened a .ai file my boss of the edited text wants in and would like to know how I can find out what are the existing text is written in so I can make some adjustments.

    It seems that you have opened the file in Illy; If this is the case, there are two is:

    (1) the text is direct type, and you can simply select the (appropriate) text tool, click where you want to edit and start editing. the character palette/Panel will show you the police, but you're already working in it;

    (2) the text is the indicated Type and so only vector paths, and you can not change, so you will need to recreate the tool text (suitable); There is no information on the police, so you have to squeeze out those who created the work, or use one of the sites listed below or similar), or ask here or in the forum of typography;

    http://new.MyFonts.com/WhatTheFont/

    http://www.Identifont.com/

    http://www.WhatFontis.com/

    http://www.bowfinprintworks.com/ScriptIDGuide.html

    http://forums.Adobe.com/community/design_development/typography?view=discussions&start=0

    (2) the text is the indicated Type and so only vector paths, but the one who created the work was bright enough to keep a copy of the original direct Type, no doubt (on a) hidden (layer); in this case, you can show it off and use it / see who makes it.

    (Hope hope for 1) or 3).

  • CSS - question text style

    Can anyone identify what kind of text style is?  If you look at the header or the net asset value, it seems that the text is cut off.  I found the text shadow in the style sheet, but I do not think that it what it does.

    Any help would be appreciated.

    http://crushlovely.com/

    Does that answer your question?

    text-decoration: none;

    Color: #000000;

    text-shadow: 1px 0pt 0pt rgba (255, 255, 255, 0.7);

    text-transform: uppercase;

    do-family: Helvetica, Arial, without serif.

    make-style: normal;

    do-variant: normal;

    make-weight: bold;

    font size: 0.785em;

    line-height: normal;

    do-size-adjust: none;

    do stretch: normal;

    -x-police-system: none;

    Outline-width: medium;

    outline-style: none;

    the outline color:-moz-use-text-color;

  • Help, please!  Question text animation.

    Hello

    It is perhaps a silly question, but this is really stumping me.  I want to animate a title using some of the predefined text animations, but I can't seem to apply an animation that makes the text appear AND an animation that makes the text disappears.  I can do one or the other, but not both.

    For example, I want my title text appear with "FocusIn", and I want it to disappear with 'DropOutByCharacter '.  How can I do this?  I have looked everywhere and lost a whole day trying to figure this!

    Thank you.

    -epompa03

    Unfortunately, you can only apply an animation at the same time.

    However, you can duplicate your title, put both titles from end to end and apply an animation of the opening one and one fence to another.

  • Regex question

    Someday I'll learn Regex. However, that day is not yet. What I have to do is choose the string in square brackets [abcde] returns abcde. I thought it would be something like------[(.+)------] but I can't run in LabVIEW. Suggestions?

    You have the regular expression on the right. Here is the code that I tested. (One of the constants represent values in controls and indicators)

  • BlackBerry 10 text Message Conversation with a Contact with multiple numbers

    Hello

    On my Z10, when I get a text from a contact with multiple numbers, is there a way to determine what number he sent? Similarly, after I send a text to someone, determine what number (or e-mail address) I chose when composing?

    Thank you!

    Hi annam.

    There is no way to see what phone number was used to send the message, if they use several mobile numbers. However, when you answer, it will automatically return to the number, he was sent by.

    Thank you.

  • Question text field

    Hello world

    I have new development in blackberry and this forum, I m building an aplication and I want to put a field beside the other textField, because when I add two textfield in my aplication always put a text in the field below to another

    Thank you for all

    Look at using VerticalFieldManager and HorizontalFieldManager to define the layout of your fields.

  • the service of Proxy HTTPS url conversion

    Hello

    Based proxy wsdl based service is accessible via http://nomh get: port/ProxyServiceName I wan t to my proxy service to host a url https://hostname:port / ProxyServiceName and wsdl for this power of Attorney must also be accessible using https://hostname:port / ProxyServiceName? WSDL, I checked the required checkbox HTTPS and when I type the url https://hostname:port / ProxyServiceName it does not open, but the port is changed to https://hostname:7002 / ProxyServiceName can someone help me as well as I can also change HTTPS without changing the port.

    Rgds,
    Rahul

    Rahul,

    Enable SSL on your Weblogic Server and set the value of the port SSL listening the current value of the listening port and change the value in the listening Port.

    http://docs.Oracle.com/CD/E17904_01/Web.1111/e13707/SSL.htm#i1200848

    Kind regards
    Anuj

  • Interactive pdf question, text will not be displayed during playback of the slidewshow

    I'm having a hard time trying to figure out how I can add text high file mp4 am and do work when exported as an interactive pdf. For some reason any the mb4 plays very well, but the text will not appear. It looks like it will work fine when I look at the windon preview swf in indesign. I can add text has to a page with a picture im in the back and works very well. But do not know why the text will not appear up if its a mp4 file instead. someone at - it suggestions?

    Interactives to go above the static elements. You can try to convert the text to a button, but I don't know if it will work in a PDF document.

Maybe you are looking for

  • Satellite Pro U400 BIOS update failed - what is the BIOS Boot-block access

    Hello My last update of the BIOS has failed and my laptop PSU45E PrU400 Satellite is now out of use.I want to use the recovery disk of crisis with a USB floppy drive, but I don't know the key combination to run the boot block.Is that someone can help

  • How do I use all my favorites alphabetically in 1 folder?

    Get introduced to IE to Firefox, I moved all my favorites. Since then, I've added a few, but I can't quite understand how easily resort them in alpha order in a single folder? I must be missing something but I can't quite. Any help would be appreciat

  • update my graphics card on a HP Pavillion 23 AIO

    product number: H3Z61AA #ABA model: 23-d034 OS: Windows 8 A6 AMD vision can I update the graphics card on this subject? can help you guys? thacks for answer

  • HP envy 5530: hp eprint

    Hi I sent me a document scanned directly from my printer, but no longer have access to the email account that I sent him.  Is there anyway I can retrieve the scanned document as I don't have the paper copy?  Thank you

  • Pavilion p7-1040nl: the BIOS update gone wrong; PC does not start.

    Hi, I tried to update my BIOS yesterday, but in the middle of doing so, there was a short cut (what are the chances right?). If the update is not good. And now my pc won't start at all. At the beginning until you get 8 beeps, the hard drive of fans,