Shoutbox

PHP: Bold text in Excel and regex - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: PHP: Bold text in Excel and regex (/showthread.php?tid=66981)

PHP: Bold text in Excel and regex by Weyzza on 10-05-2006 at 04:01 AM

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


RE: PHP: Bold text in Excel and regex by WDZ on 10-05-2006 at 04:06 AM

This works for me...

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

As for question 1, umm... no idea. :p


RE: PHP: Bold text in Excel and regex by Weyzza on 10-05-2006 at 04:17 AM

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.


RE: PHP: Bold text in Excel and regex by WDZ on 10-05-2006 at 04:21 AM

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
RE: PHP: Bold text in Excel and regex by -dt- on 10-05-2006 at 06:32 AM

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?
RE: PHP: Bold text in Excel and regex by Weyzza on 10-05-2006 at 07:23 AM

.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"