PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Okay, I've started working on this project again and I'm still having regex problems. In my last question, the solution that I proposed, (^.*\D), worked for picking all of the non-number characters off of the beginning of a string. However, I now want that length of letters back so I can use it. The length of characters can be of different lengths, too.
feyd wrote:your topic subject needs a bit of work.
Not anymore.
bimo, it's best to describe the problem a little in the title. That way maybe someone very good with whatever problem your having can have their attention caught, and can read your problem.
Well, it's a simple problem very similar to my last question about taking the last six digits off of a string. The difference is that now I want to take the letters off of the beginning of the string but an indeterminate # of letters.
First thing I thought I'd try was preg_split with PREG_SPLIT_DELIM_CAPTURE and put the two different halves into an array. I didn't know what regex to use, though and figured preg_split would be a more immediate solution that would take the least ammount of readjustment to my code to get it to work.
I put a couple of examples of the things that I tried last night (I tried many more but didn't save them).
I hope that this is more clear. Sorry about before. It was late... I was tired... Probably should have just gone to bed.
thanks again, feyd. I had been trying that regex but wasn't leaving the hashes in (I;ve never seen regexes written like this and the book I'm using only has a short chapter of them.) So I tried leaving them in and, what do you know, it worked after all.
that's why I specified it's for a preg_* function. the preg_* functions have pattern start and stop symbol markers, so you can add modifiers to alter how the regex runs.