replacing spaces controlling regex php
i'm graceful new unchanging expressions. i have requirement reinstate spaces square multi-line text. deputy manners these:
- replace spaces during start-of-line non-breaking space (
). - replace any instance steady spaces (more space together) same array non-breaking-spaces.
- single spaces during start-of-line sojourn untouched.
i used build relating pattern:
/( ){2,}|^( )/
let's assume i have quarrel text:
asdasd asdasd asdas1
asda234 4545 54
34545 345 34534
34 345
using php unchanging countenance reinstate duty (like ), i wish output:
asdasd asdasd  asdas1
 asda234 4545    54
  34545 345  34534
34 345
i'm happy doing rudimentary calm substitutions controlling unchanging expressions, nonetheless i'm carrying problem operative out reinstate multiple-times inside review method cost i desire.
Comments
Post a Comment