Hi there, hope you guys can help! I'm not a PHP coder by nature (Delphi/Pascal) but I can kinda wing my way (probably badly!). However I'm trying to write a feature and I'm having problems! I believe the answer lies in regex but I'm not sure.
Quick synopsis -
Table full of player names
Scripts polls bf2 server and gets players names
Script now needs to see if player is on the table....
Easy enough - BUT - the player will have a prefic on his name which can if in 3 different formats, each containing different layouts and data.
e.g. the online format should be 2X.YYY.Name - where X=Squad and Y=Rank e.g. 2.H.Pvt.Mat-d-rat - I have a list of the formats (only 3 at the moment) and I was thinking that if I can preg_match the name then I should be able to delete the front part off it and find the player in the database!
So I start to look at regular expressions - well I understand some of it, but then it all goes to pot!
e.g. I believe my expression needs to be
starts with 2
any character/number
period
any group of chars (2-4)
period
So tried to start to form this into an expression /2/ but then it all went to pot 🙁
If someone can help me through this, can you even do random length wildcards as such? Or am I barking up the wrong tree, and if so which tree should I be barking up instead.
TIA