hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Regex question numerical sequence
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Regex question numerical sequence

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 10-29-2011, 02:22 PM
Hayworth Hayworth is offline
Junior Guru Wannabe
 
Join Date: Jun 2008
Posts: 54

Regex question numerical sequence


I'm no good at regexp's. I am working in Adobe Dreamweaver cS4. It can manage regular expressions. I am preparing an ebook and I need to resolve this problem:

I have this numerical sequence:

<span class="txt">97

<span class="txt">98

<span class="txt">99

<span class="txt">100

<span class="txt">101


I need to change to change to

<span class="txt">097

<span class="txt">098

<span class="txt">099

<span class="txt">100

<span class="txt">101


I need to add an 0 before all the numbers with two digits.

I need to Find/Replace about 7.000 cases.

I'm very newbie in regex. I need the code to put in the field to shearch and the code to put in the field to replace.

Thank you in advance.

Reply With Quote


Sponsored Links
  #2  
Old 10-29-2011, 06:25 PM
RJohnson23 RJohnson23 is offline
WHT Addict
 
Join Date: May 2010
Posts: 173
Find: <span class="txt">([0-9]{2})\b
Replace: <span class="txt">0$1

[0-9] matches any number
{2} limits it to exactly 2 numbers
\b matches the end of a string

Reply With Quote
  #3  
Old 10-29-2011, 06:54 PM
Hayworth Hayworth is offline
Junior Guru Wannabe
 
Join Date: Jun 2008
Posts: 54
* It works perfectly

It works perfectly for me.

Thanks so much! you (and regex) just saved me several tons hours of work!

Reply With Quote
Sponsored Links
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regex question Adonis Programming Discussion 7 03-31-2009 06:08 PM
(paid work) PHP regex guru is needed for very complicated regex requirement mrzippy Employment / Job Offers 2 03-30-2006 05:10 PM
Regex / Modrewrite question... nsanden Programming Discussion 5 07-12-2005 08:57 PM
[PHP] regex question !!! hookgr Programming Discussion 5 12-26-2004 09:01 PM

Related posts from TheWhir.com
Title Type Date Posted
The Value of Your Intellectual Property Blog 2013-05-06 17:43:13
Texas Company Claims Web Encryption Infringes its Patent in Suit Against Intel, Yelp, Others Web Hosting News 2012-11-08 11:14:00
Joomla Hosting Study Shows Speed, Uptime Top Selling Points of a Web Host Web Hosting News 2012-11-07 15:06:36
Rackspace Blog Looks at Easy Outsourcing for App Development Blog 2012-03-05 19:07:48
Blackberry the UnCloud Blog 2011-10-14 15:28:54


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?