User Profile

Collapse

Profile Sidebar

Collapse
exidas
exidas
Last Activity: Sep 12 '12, 07:53 AM
Joined: Nov 7 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • exidas
    replied to Regular Expressions
    in PHP
    works great with some differences... final function:

    Code:
    	protected function prepare_mask_to_edit($identifier,$required_mask=null) {
    	$mask = (!is_null($required_mask)) ? $required_mask : $this->mask;
    	preg_match('#\[('.$identifier.'+)\]#', $mask,$matches);
    		if(is_array($matches)) {
    			$question_mark = str_replace($identifier,'?',$matches[1]);
    			$editable_mask = str_replace($matches[1], $question_mark,
    ...
    See more | Go to post

    Leave a comment:


  • exidas
    replied to Regular Expressions
    in PHP
    I don't know if i exactly understand what you mean. Can you write down some simple example of your imagine? Do you mean sthg like this?

    str_replace(pre g_match('/(\[)(N+)(\])/', '?', $mask));

    Cause this will replace match with single question mark again. Thanks very much.
    See more | Go to post

    Leave a comment:


  • exidas
    started a topic Regular Expressions
    in PHP

    Regular Expressions

    Hi guys,
    i need replace all specified characters (in this case its "N") between the square parentheses by the question mark ("?"). I have dynamic/variable string mask, for example something like CON[NNNN][YYYY] and as output i need to get CON[????][YYYY]. So simply explained replace everything between parentheses by specified sign as many times as the length of match is.

    I'm looking for something like:...
    See more | Go to post
No activity results to display
Show More
Working...