Any chance someone could help me out here please?
I use textpad regualry think it’s great. I’ve spent some time developing a set of regular expressions to go through our entire site and I’ve finally got the code right.
I then found Wild Edit and knew it would be a good product from the textpad creators. I need to change plus 2000 page and I can see that it will do what I want but I can’t make it happen!
I’m trying to locate all instances of (123K) or (123 K) and replace the K in each instance with KB. Of course there could be other sintances of K on the site so I really have to find the numbers along side it.
I've got a formula that works perfectly in Textpad:
Find: \([0-9]+\)\([K]\)
Replace with: \1KB
But it doesn't work in Wildedit, just puts a unregconisable character and KB, lsing the numbers. I've read the intructions and tried just about everything I can think of - does anyone have any better ideas? I't sHTML pages I'm editing if that helps.
Thanks,
Jenny
Wild Edit - Replace Part of Search String
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 1
- Joined: Wed Jan 18, 2006 2:35 pm
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
WildEdit uses Perl/Posix-style regular expression syntax, not the old sed-style syntax.
Look at WildEdit's help under Reference | Regular Expression Syntax. TextPad's help under How to... | Find and Replace Text | Use Regular Expression is also useful. With this style you need to drop the backslash escapes on the parentheses:
Look at WildEdit's help under Reference | Regular Expression Syntax. TextPad's help under How to... | Find and Replace Text | Use Regular Expression is also useful. With this style you need to drop the backslash escapes on the parentheses:
The character class [K] contains a single character, so a simple K will do. And you don't need to capture the K, so you don't need the parentheses around it:Find what: ([0-9]+)([K])
You wanted an optional space between the number and the K:Find what: ([0-9]+)K
For the replacement expression, look at WildEdit's help under Reference | Replacement Format Syntax. You need to use $ instead of \:Find what: ([0-9]+) ?K
Replace with: $1KB