The prosecution may not avoid the two-dismissal rule provided for in Penal Code section 1387 by charging a new offense or allegation in a third filing that would increase the offense originally charged to a violent felony when the charged offense in the prior two dismissals was not a violent felony. The first complaint charging appellant with battery by a prisoner on a non-inmate (Pen. Code, § 4501.5) was dismissed on the prosecutor’s motion when the court declared a doubt as to appellant’s competency. A second complaint alleging the same offense was filed. Appellant was held to answer, and the prosecutor filed an information alleging the section 4501.5 violation as well as a section 4501 violation, based on the same offense. This information was dismissed when the court granted a section 995 motion based on the denial of the right to self-representation. When a third complaint was filed alleging the same two offenses, appellant filed a motion to dismiss invoking the two-dismissal rule in section 1387, and noting a third filing was barred under the section 1387.1 exception because the offenses alleged were not violent ones under section 667.5. The trial court denied the motion based on the prosecutors stated intent to amend the complaint to allege great bodily injury enhancements under section 12022.7, which would render the offenses violent ones. Appellant made the same argument on appeal. The Court of Appeal noted that section 1387.1 does not expressly identify what offenses must be violent to permit a third filing. But, applying the rules of statutory construction, the court found that based on the plain meaning of the words in the statute and their juxtaposition it is implicit “that the violent felony offense for which charges may be refiled must be one of the charged offenses previously dismissed.” Since neither of the first two dismissed accusatory pleadings alleged a violent felony, the filing of a third complaint under Penal Code section 1387.1 was not permitted, and appellants motion to dismiss should have been granted.