Sunday, 15 September 2013

javascript - regex jquery to replace number with link -


I have a database result page, where users sometimes type in the context of another post (database scheduling The event tracker for the day is for the office.)

The reference to the other post is always the post id (format of 001234). We use these to match the events with the dock and other paperwork from truck drivers. It is always the 6 digit number of its own.

  & lt; Div class = "eventswerper" & gt; Using data from DB here is using PHP in a foreach loop. For example, presents data in a similar fashion to Facebook & lt; / Div & gt;  

I need to do this once that the data is loaded once in the above DIV, then go through the whole 6 digit number (not part of any number) and Hyperlink it

It is important that it only appears for numbers with a location:

  Example: referee 001122  

Once I have a hyperlink tag, I can make a clickable reference number to take users directly to that post.

I'm good, but I think this is something like this:

  \ b (! [0-9])? \ D {6} \ b  

I do not know how to search the DV and then replace that rage with a hyperlink. Appreciate any help

(?: ^ |) \ D {6} (? | $) < / Pre>

You can use it and & lt; Space & gt; & Lt; Whateveryouwant & gt; . See the demo.

\ b wont work because A1 is not a word limit which you Want to


No comments:

Post a Comment