Hi all,
Here is what I want in the following there is a list of ID's like the following given but the condition should be that the number of digit should not exceed 4.
id="sb0001"
id="sb0002"
....
....
id="sb0020"
now while using id="sb000\i(1,1)" it shows the following output which is wrong.
id="sb0001"
id="sb0002"
....
....
id="sb00020"
Could you please let me know that whether we could give any condition to it so that the number of digit should not exceed more than 4 digit.
Kindly help.
Rgds,
Prashob N.
Query regarding increment operator
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
Have no idea what you are doing, but you can do a search for strings with more than 4 digits.
And you could replace those string with something else. You could drop any of the digits to make a length of four, but you need to provide the rules.
If the string has 5 digits, would you drop the first, or last, or one in the middle? If the string has 8 digits, which ones would you drop?
Search for: "sb[0-9]{5,}" to find strings "sbxxxx" with 5 or more digits for the x.
And you could replace those string with something else. You could drop any of the digits to make a length of four, but you need to provide the rules.
If the string has 5 digits, would you drop the first, or last, or one in the middle? If the string has 8 digits, which ones would you drop?
Search for: "sb[0-9]{5,}" to find strings "sbxxxx" with 5 or more digits for the x.
Hope this was helpful.............good luck,
Bob
Bob
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
I think Prashob wants 4-digit sequence numbers. Unfortunately, TextPad can't generate them directly. But, as Bob suggests, after generating the sequences numbers with an excess of leading zeros, you can trim them off:
Or, more generally:Find what: "sb0+([0-9]{4})"
Replace with: "sb\1"
[X] Regular expression
These assume you are using Posix regular expression syntax:Find what: [^0-9]0+([0-9]{4})
Replace with: \1\2
[X] Regular expression
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax