Converting a reference string to lowercase
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
Converting a reference string to lowercase
I am performing the following search and replace:
[Ii]-(\w{3,})-(\d{3,})
(eg. I-ABC-123)
Replace with:
<a href="http://www.xxx.com/dir1/dir2/dir3/i-$1-$2.pdf">$0</a>
This is basically working, however the string that I receive in $1 (in the above example, ABC) is currently in uppercase and I would like to convert it to lowercase in the hyperlink.
Any suggestions?
[Ii]-(\w{3,})-(\d{3,})
(eg. I-ABC-123)
Replace with:
<a href="http://www.xxx.com/dir1/dir2/dir3/i-$1-$2.pdf">$0</a>
This is basically working, however the string that I receive in $1 (in the above example, ABC) is currently in uppercase and I would like to convert it to lowercase in the hyperlink.
Any suggestions?
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
See lesson 5 in the help file. (About fifth item down in the contents).
It looks like this:
It looks like this:
Code: Select all
Perl pattern [[Ii]-(\w{3,})-(\d{3,}) ] with [<a href="http://www.xxx.com/dir1/dir2/dir3/i-$1-$2.pdf">$0</a> ]
| [X] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [ ] Maximum match (greedy)
| [ ] Allow comments
| [X] '.' matches newline
| [ ] UTF-8 Support
|
+--Convert to lowercase
The result isn't exactly what I'm after. I'm trying to end up with the following hyperlink:
<a href="http://www.xxx.com/Dir1/Dir2/Dir3/i-$1-$2.pdf">$0</a>
Where parts of the path could potentially be upper and/or lower case. However, I need to make ONLY what appears in the string from $1 to be lowercase, while leaving the rest of the path untouched. The example that you provided me converts the entire hyperlink to lowercase instead of just what appears in $1.
Is this doable?
<a href="http://www.xxx.com/Dir1/Dir2/Dir3/i-$1-$2.pdf">$0</a>
Where parts of the path could potentially be upper and/or lower case. However, I need to make ONLY what appears in the string from $1 to be lowercase, while leaving the rest of the path untouched. The example that you provided me converts the entire hyperlink to lowercase instead of just what appears in $1.
Is this doable?
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact: