What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP: Bold text in Excel and regex

PHP: Bold text in Excel and regex
Author: Message:
Weyzza
Veteran Member
*****

Avatar
SoCal sunset > *

Posts: 1170
Reputation: 29
– / Male / –
Joined: May 2003
O.P. PHP: Bold text in Excel and regex
1) How do you write/insert a bold text into an Excel file using PHP?
Do I need to use some Excel formula?

2) What is the regex for "abcde_1234567890.txt" if I'm to use preg_match()?
"abcde_" and ".txt" is fixed; the numbers vary but is always be 10 digits.
Is it $var = "/^abcde_[0-9][10].txt/"; ?
I think this is supposed to be easy, but I'm stupid :p
Registered 7853 days, 1 hour, 40 minutes, 22 seconds ago.
Happy Birthday, WDZ

10-05-2006 04:01 AM
Profile PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: PHP: Bold text in Excel and regex
This works for me...

/^abcde_([0-9]{10})\.txt$/

As for question 1, umm... no idea. :p
10-05-2006 04:06 AM
Profile PM Web Find Quote Report
Weyzza
Veteran Member
*****

Avatar
SoCal sunset > *

Posts: 1170
Reputation: 29
– / Male / –
Joined: May 2003
O.P. RE: PHP: Bold text in Excel and regex
Why do I need a $ there?
Is it like a ^ but placed at the end of the regex?

And yeah, it's supposed to {10} :p
* Weyzza blames some random online tutorial for using dodgy font.

* Weyzza waits for someone to answer the first question.
Registered 7853 days, 1 hour, 40 minutes, 22 seconds ago.
Happy Birthday, WDZ

10-05-2006 04:17 AM
Profile PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: PHP: Bold text in Excel and regex
quote:
Originally posted by thekid
Why do I need a $ there?
Is it like a ^ but placed at the end of the regex?
Yeah, exactly. You don't need it, but without it, you could match abcde_1234567890.txt.bak or something... :p
10-05-2006 04:21 AM
Profile PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: PHP: Bold text in Excel and regex
quote:
Originally posted by thekid
* thekid waits for someone to answer the first question.
well it depends on how your making this excel file, are you on windows using the excel com object or are you trying to make it the non com way using some crazy php class?
[Image: dt2.0v2.png]      Happy Birthday, WDZ
10-05-2006 06:32 AM
Profile PM Web Find Quote Report
Weyzza
Veteran Member
*****

Avatar
SoCal sunset > *

Posts: 1170
Reputation: 29
– / Male / –
Joined: May 2003
O.P. RE: PHP: Bold text in Excel and regex
.g com object

Definitely not :p

I just use a simple method in writing the excel file i.e. using \t for separating cells. Nothing special. Didn't even create a class :p

So I guess I'm trying to make it "the non com way"
Registered 7853 days, 1 hour, 40 minutes, 22 seconds ago.
Happy Birthday, WDZ

10-05-2006 07:23 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On